http://qs1969.pair.com?node_id=307281

Your own Perl code displays itself with colored tags on a web page! Best if the entire web page is a CGI.
# display this Perl CGI code! open (HIN,"code.pl") or die "Unable to read $0 file: $!\n"; @code=<HIN>; close (HIN); foreach (@code) { # prevent html code from activating s/&/&amp;/g unless /\x26\x26/; s/</&lt;/g; # colorize comments in the code s@#(.*)$@<span style="color:green;">#$1</span>@g if /#\s/&&!/#\(/; # colorize certain Perl keywords s@^#!(.+)@#<span style="color:purple;">!$1</span>@; s@(\s*print\s*|elsif|eq\s|ne\s|foreach|while|open\s|close\s|if\s|use\s +|die\s|\sor\s)@<span style="color:red;">$1</span>@ig unless /\(print/ +; s@(\x26\x26\s|\x2d>|\x3d>|\x2e=|\x7c\x7c\s|\x3a\x3a|\x2d\x2d|\x2b\x2 +b)@<span style="color:#CC33FF;">$1</span>@g;# && -> => .= || :: -- ++ # colorize variables s@([\$\@]\w+)@<span style="color:blue;">$1</span>@g; # vars s@([\$\@][!_|])@<span style="color:blue;">$1</span>@g; # $! $_ $| @! + @_ @| # add this changed code to the stream $purl.=$_; } print "<font size=-1><pre>$purl</pre></font>"; # end