in reply to Get HTML source code

One way that I would do it is instead of printing out the HTML while the script is running, store it all into a variable. Then, at the very end of the script, print out the variable, and do whatever else you wanted to with it. That way, the variable will have all your HTML source code in it.

Replies are listed 'Best First'.
Re^2: Get HTML source code
by maestro_ba (Initiate) on Nov 04, 2005 at 17:34 UTC
    The solutions by ickyb0d and Spidy require that I add a line EVERYTIME I have a print!
    They were the first solutions that came to me, but I wanted to find out a way to avoid doing them...
      Well, you'd just replace your print lines with
      $codeVariable .= qq ~ ~; #whatever was going to be printed goes inside + the quotes
      And then at the very end of the script, you'd have:
      print $codeVariable;
      It's just one extra line added.
        You're right.
        But I don't want to use that solution because my script takes lots of time running, and the way it is now it shows up as it is processing.
        And if I do as you describe I will only see the HTML page at the end.
        Thanks anyway... =)