in reply to Get HTML source code

In the realm of CGI, printing to the browser is really just printing to the handle STDOUT. This means you can simply redirect STDOUT to write to both a file of your choice and the usual STDOUT.

# near the top, before you print open FILE, '>', 'output.txt' or die ("Can't write output.txt: $!"); open STDOUT, '>&FILE>&STDOUT' or die ("Can't redirect STDOUT properly: + $!");

Remember to close FILE before your script ends. (even though the script ending should cause it to go out of scope and close, better to do so explicitly).

<-radiant.matrix->
A collection of thoughts and links from the minds of geeks
The Code that can be seen is not the true Code
"In any sufficiently large group of people, most are idiots" - Kaa's Law