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.


In reply to Re: Help, how do I print out to an html file, not the .pl page by Asim
in thread Help, how do I print out to an html file, not the .pl page by dawnamarr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.