Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Re: [Andy] Code function.

Quote Reply
Re: [Andy] Code function. In reply to
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:

#! /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
Subject Author Views Date
Thread Code function. bluesnavigator 3104 Nov 21, 2004, 11:08 AM
Thread Re: [bluesnavigator] Code function.
Andy 3014 Nov 22, 2004, 4:15 AM
Thread Re: [Andy] Code function.
twist 2993 Nov 22, 2004, 5:47 AM
Thread Re: [twist] Code function.
Andy 3006 Nov 22, 2004, 5:53 AM
Post Re: [Andy] Code function.
twist 2999 Nov 22, 2004, 6:14 AM