Home : Products : Gossamer Forum : Discussion :

Products: Gossamer Forum: Discussion: Re: [Andy] Code function.: Edit Log

Here is the list of edits for this post
Re: [Andy] Code function.
The code tags can still break, though, even if it's used for non markup presentation. Consider, for example regex syntax in perl. I appreciate that this is a highly contrived example, but it illustrates the point that the code tags should disable the interpretation of the markup tags even though the code being presented:

Code:
#! /usr/bin/perl

# Read from STDIN, and print each line out when it begins with 'i',
# or ends with either '/' or 'i'. Case insensitive.

use strict;
use warnings;

while (<STDIN>)
{
print if (m|^|i || m||i);
}

As you can see, the code between the code tags is not faithfully reproduced, becuase the [i] and [/i] are being interpreted as markup, and not as part of the source code. This is clearly wrong behaviour.

Cheers Smile

Last edited by:

twist: Nov 22, 2004, 5:48 AM

Edit Log: