in reply to Get HTML source code
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)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Get HTML source code
by jeffa (Bishop) on Nov 04, 2005 at 17:06 UTC |