Seems kind of silly to me to recreate the functionality that the browser provides for free, but here is a quick hack:
use strict; use warnings; use CGI qw(:standard); my $html = do {local $/;<DATA>}; if (param('view_source')) { $html = pre(escapeHTML($html)); } print header, $html; __DATA__ <html> <head> <title>view source example</title> </head> <body> <h1>view source example</h1> <a href="?view_source=1">view source</a> </body> </html>
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: Get HTML source code
by jeffa
in thread Get HTML source code
by maestro_ba
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |