This is just a 'test11.pl' scenario, built in DEBUG mode ... spaces are EXPANDED ... line numbers added ... that is a 'parser' view ... the 'red', 'green', and 'white' space representation shows the 'state' of that space - red = artificial, that is, will be removed when debug is OFF ... green=should be removed, without debug ... white=as per original line ...
Also, in p2html10.pl, the colours are per a generated set of colour functions, from internal set arrays ... the bottom is the list supported by Internet Explorer 4, hopefully also by 6++ ;=))
| 1 |  | 
| 2 | if ( "this" eq 't' . "$var" ) { | 
| 3 | #if("this"eq't'."$var") { as comment | 
| 4 |  | 
| 5 | $a = '500$' ; # '; | 
| 6 | $_ = join ( "" , @lines ) ; | 
| 7 | $a = '500$' ; # '; | 
| 8 | $_ = join ( "" , @lines ) ; | 
| 9 | s#//#/#\; | 
| 10 | print DSP << "EOF" ; | 
| 11 | line $file_lines: Next file line with $mfile ... | 
| 12 | EOF | 
| 13 |  | 
| 14 | print DSP << EOF ; | 
| 15 | line $file_lines: Next file line with $mfile ... | 
| 16 | EOF | 
| 17 |  | 
| 18 | @ { 'Formats' } { $_ } } [ 0 . . $# { $tmphash { $_ } } ] = @ { . . $# { $tmphash { $_ } } ] ; | 
| 19 | $tmphash | 
| 20 | $self -> { 'Formats' } { $_ } [ 0 ] = $tmphash { $_ } foreach ( keys %tmphash ) ; | 
| 21 |  | 
| 22 | 'last_token_type' => '' , # Type of the last token. | 
| 23 | $builtin_vars_re = | 
| 24 | qr/ \$\# ? _ | 
| 25 | | \$ ( ?:\^[LAECDFHIMOPRSTWX]|[0-9&` '+*.\/|,\\";#%=\-~^:?!@\$<>()\[\]]) | 
| 26 | | \$\# ? ARGV ( ?:\s*\[)? | 
| 27 | | \$\# ? INC\s * \ [ | 
| 28 | | \$ ( ?:ENV|SIG|INC)\s*\{ | 
| 29 | | \@ ( ?:_|ARGV|INC) | 
| 30 | | \% ( ?:INC|ENV|SIG) | 
| 31 | /x; | 
| 32 |  | 
| 33 |  | 
| 34 |  | 
| 35 |  | 
| 36 | tolog ( "$0 Started " . localtime ( time ( ) ) . " ...\n" ) ; | 
| 37 |  | 
| 38 | sub add_html_head { | 
| 39 | my ( $fh , $hdr ) = @_ ; | 
| 40 | print $fh << EOF ; | 
| 41 | < html > | 
| 42 | < ! -- P26 . 2005 . 05 . 10 geoffmclane . com perl | 
| 43 | HTML generated using p2html5 . pl - | 
| 44 | -- > | 
| 45 | < head > | 
| 46 | < title > $hdr < /title> | 
| 47 | </head> | 
| 48 | EOF | 
| 49 | # dynamic block of style - could be put to a file ... | 
| 50 | add_html_style ( $fh ) ; | 
| 51 |  | 
| 52 | print $fh << "EOF" ; | 
| 53 | < body > | 
| 54 | < h1 align = "center" > $hdr < /h1> | 
| 55 |  | 
| 56 | < p align = "center" > < a href = "perl.htm" > back < /a></p> | 
| 57 |  | 
| 58 | EOF | 
| 59 |  | 
| 60 | } | 
| 61 |  | 
| 62 | ## } elsif ( isresword ($tx2) ) { ### exists $HResWds{$tx2} | 
| 63 | ##    $func = \&blue; | 
| 64 | sub add_uresword { | 
| 65 | my ( $rw ) = @_ ; | 
| 66 | if ( exists $HResWdFnd { $rw } ) { | 
| 67 | $HResWdFnd { $rw } ++ ; # another count | 
| 68 | } else { | 
| 69 | $HResWdFnd { $rw } = 1 ; # start count | 
| 70 | } | 
| 71 | } | 
| 72 |  | 
| 73 | my @TTColrs = qw ( l . blue brown   l . br   s . green pink   mauve     b . green l . brn blue     white l . grey ) ; | 
| 74 | my @TTTypes  = qw ( array comment unass  s - quote scalar functions d - quote hash  reserved other punctuation ) ; | 
| 75 | my @TTAttrib = qw ( match orange  regex  green   color1 color2    color3  peach blue     white grey ) ; | 
| 76 |  | 
| 77 | # convert to HTML | 
| 78 | $txt =~ s/\t/$tab_stg /g; # substitute TAB characters | 
| 79 | $txt =~ s/ "/"/g; # sub double quotes | 
| 80 | $txt =~ s/\</</g; # sub less than tag beginning | 
| 81 | $txt =~ s/\>/>/g; # and html/xml tag ending | 
| 82 | my $ln = length ( $txt ) ; # get the final length | 
| 83 |  | 
| 84 | open $LF , ">$logfil" or die "Can NOT open LOG file $logfil!\n" ; | 
| 85 |  | 
| 86 | tolog ( "$0 Started " . localtime ( time ( ) ) . " ...\n" ) ; | 
| 87 | if ( ! - f $infile ) { | 
| 88 | die "Input file [$infile] NOT FOUND! ...\n" ; | 
| 89 | } | 
Colour Key :
Function, Description., Colour
| Style | Description | Colour | 
|---|---|---|
| match | @array | l.blue | 
| orange | comment | brown | 
| regex | unass | l.br | 
| green | s-quote | s.green | 
| color1 | scalar | pink | 
| color2 | functions | mauve | 
| color3 | d-quote | b.green | 
| color4 | color4 | color4 | 
| color5 | color5 | color5 | 
| peach | hash | l.brn | 
| blue | reserved | blue | 
| white | other | white | 
| grey | punctuation | l.grey | 
Parse stats
| Reserved Words 
 | Built-in Functions 
 | Punctuation Used 
 | Arrays 
 | Hash 
 | Scalar 
 | 
List of colours by IE 4 ...
| 
aliceblue | 
antiquewhite | 
aqua | 
aquamarine | 
| 
azure | 
beige | 
bisque | 
black | 
| 
blanchedalmond | 
blue | 
blueviolet | 
brown | 
| 
burlywood | 
cadetblue | 
chartreuse | 
chocolate | 
| 
coral | 
cornflowerblue | 
cornsilk | 
crimson | 
| 
cyan | 
darkblue | 
darkcyan | 
darkgoldenrod | 
| 
darkgray | 
darkgreen | 
darkkhaki | 
darkmagenta | 
| 
darkolivegreen | 
darkorange | 
darkorchid | 
darkred | 
| 
darksalmon | 
darkseagreen | 
darkslateblue | 
darkslategray | 
| 
darkturquoise | 
darkviolet | 
deeppink | 
deepskyblue | 
| 
dimgray | 
dodgerblue | 
firebrick | 
floralwhite | 
| 
forestgreen | 
fuchsia | 
gainsboro | 
ghostwhite | 
| 
gold | 
goldenrod | 
gray | 
green | 
| 
greenyellow | 
honeydew | 
hotpink | 
indianred | 
| 
indigo | 
ivory | 
khaki | 
lavender | 
| 
lavenderblush | 
lawngreen | 
lemonchiffon | 
lightblue | 
| 
lightcoral | 
lightcyan | 
lightgoldenrodyellow | 
lightgreen | 
| 
lightgrey | 
lightpink | 
lightsalmon | 
lightseagreen | 
| 
lightskyblue | 
lightslategray | 
lightsteelblue | 
lightyellow | 
| 
lime | 
limegreen | 
linen | 
magenta | 
| 
maroon | 
mediumaquamarine | 
mediumblue | 
mediumorchid | 
| 
mediumpurple | 
mediumseagreen | 
mediumslateblue | 
mediumspringgreen | 
| 
mediumturquoise | 
mediumvioletred | 
midnightblue | 
mintcream | 
| 
mistyrose | 
moccasin | 
navajowhite | 
navy | 
| 
oldlace | 
olive | 
olivedrab | 
orange | 
| 
orangered | 
orchid | 
palegoldenrod | 
palegreen | 
| 
paleturquoise | 
palevioletred | 
papayawhip | 
peachpuff | 
| 
peru | 
pink | 
plum | 
powderblue | 
| 
purple | 
red | 
rosybrown | 
royalblue | 
| 
saddlebrown | 
salmon | 
sandybrown | 
seagreen | 
| 
seashell | 
sienna | 
silver | 
skyblue | 
| 
slateblue | 
slategray | 
snow | 
springgreen | 
| 
steelblue | 
tan | 
teal | 
thistle | 
| 
tomato | 
turquoise | 
violet | 
wheat | 
| 
white | 
whitesmoke | 
yellow | 
yellowgreen |