in reply to Get HTML source code

for each print statement you could just create another print statement that prints to a file appends the string to a variable. That should give you all the HTML data that is printed by your cgi script.

you could also visit your own webpage using something like WWW::Mechanize and just print out the content from that. But that would probably have to be within another script, and not your cgi page.