[cpan.org...]
[perl]
package "perl";
#----------- comment
$u =~ s!\=http!http!gi;
@ebean =("foo");
$enterprise=0;
print "<li>";
foreach $word (@searchwords) {
if ($title =~ /$word/ig) {
print " <font face=arial color=red> ** $word ** ";
push(@flag,$i);
$found++;
$stfound++; #---------- comment
}
}
[/perl]
&convert_time($linktime);
$wmod = $ttime . " " .$wordtime;
}
#---------------------------------------------
[/perl]
This line should not be highlighted, but in verdana at 2.
[perl]
$TAB = 8 unless $TAB;
($i,$tmp,@str,$b,$e);
$_ = $data;
$b = $e = pack("LL", ());
# s:(&):&:g;
s:>:>:g; s:<:<:g;
# Spaces and newlines
s:(\n¦\r):<BR>$&:gm;
s:\t:" " x $TAB:egm;
s:^\s+¦\s{2,}:(" " x (length($&) - 1))." ":egm;
[/perl]
[perl]
$llama = '<X>."hello"';
$camel =~ s/<X>."hello"/llama/g;
[/perl]
It is correct when it makes <X>."hello" all one color; they are merely a string and should not get color-parsing. But in the second line, when that stuff is in a regex, suddenly it tries to parse it as if it's perl code that might be executed.
One side effect is that I had to turn off the other enhancements such as bold and italic. I could have parsed them out, but once I get into that code it's already exception after exception to the other 14 exceptions.
I wasn't so interested in the syntax colorization as I was keepin the users code indentions.