in reply to Help, how do I print out to an html file, not the .pl page

First, please forgive, and reply to this note with more information, if I've misunderstood your question. I'm just taking a best guess from what you're saying here.

If you want to save the HTML you're printing to another file, first open it:

my $location_for_html_file = 'html_file.html'; open (HTML_FILE, ">$location_for_html_file") or die "Cannot open HTML +file for writing at $location_for_html_file: $!\n";

Then print to that file, using the notation that puts the filehandle you named in the open command above right after print: print HTML_FILE "Put your HTML Code here"; The HTML_FILE above tells print to send the data to the filename you opened with the open command, rather than your browser.

There is a way to send all text to it as well, for this, you'd use the select statement. However, I'd not recommend it, as you lose some control over what goes where. It's worth it, in my experience, to simply do open and print than to use select, but you can look it up and decide. Also, there are man(ual) pages for both print and open here as well, if you get stuck, you'll want to look at them to help you, and us, understand your question better.

----Asim, known to some as Woodrow.

Replies are listed 'Best First'.
Re: Re: Help, how do I print out to an html file, not the .pl page
by dawnamarr (Novice) on Apr 17, 2001 at 20:35 UTC
    Thank you too. The links are helpful.