in reply to HTML file or in-memory ?

Alternatively, if there are a lot of print statements that you'd have to change, you can print to a scalar variable. All you have to do is call open like so:
open(FH, ">", \$var);
After that, you can print to FH and the results will be accumulated in $var, which you can then use the options presented by the monks that responded before me. This all assumes a fairly recent version of perl (I don't know exactly when this feature was added).

thor

Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come

Replies are listed 'Best First'.
Re^2: HTML file or in-memory ?
by Anonymous Monk on Dec 15, 2004 at 14:23 UTC
    I tried this and I get a file called SCALAR(0x189a68). So I guess I haven't go the correct version for this to work (I'm using 5.6.1).

      Yup, it's your version. Pre 5.8 IMSMR you can use IO::Scalar to get similar functionality.