print to both STDOUT and a file?

From: Brian Volk (BVolk_at_HPProducts.com)
Date: 07/29/04


To: "Beginners (E-mail)" <beginners@perl.org>
Date: Thu, 29 Jul 2004 11:25:47 -0500

Hi All,

Is there a way to print to both the STDOUT and a physical file. other than
./script.pl >>outfile.txt ? Here is what I have now, which works great,
but I would like to see the links (about 2,000) scroll.

---- this works great, but the links don't scroll
open STDOUT, ">>C:/perl/bin/output/links_1.txt"
 or die "Can't open links file: $!";

---- this is probably my first step
open my $OUTFILE, ">>C:/perl/bin/output/links_test.txt"
 or die "Can't open links file: $!";

---- below is the loop

while (<>) {
            print "$ARGV $1\n" and close(ARGV) and next
                if /$RE{URI}{HTTP}{-keep}/;
               }

Thanks!

Brian Volk