From:                   jimf <[EMAIL PROTECTED]>

> This little script is one of my first attempts with perl, it works ok
> but I would also like to capture the output to file. Help appreciated.

You might like Ron Wantock's Local::TeeOutput.pm
( http://Jenda.Krynicky.cz/perl/TeeOutput.pm , save as 
..../lib/Local/TeeOutput.pm)

This allows you to print into several handles at once:

        open (LOG, ">>logfile.txt");
        openTee (*STDOUT, *STDOUT, *LOG);
        print "This goes both to STDOUT and the logfile.txt\n";
                # assuming of course you did not select() some 
                # other filehandle

Jenda


=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
                                        --- me

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to