print to both STDOUT and a file?
From: Brian Volk (BVolk_at_HPProducts.com)
Date: 07/29/04
- Next message: Maurice Lucas: "howto 'cat file|grep "foo bar"|wc -l' in perl"
- Previous message: Randy W. Sims: "Re: sort by extension"
- Next in thread: Chris Devers: "Re: print to both STDOUT and a file?"
- Reply: Chris Devers: "Re: print to both STDOUT and a file?"
- Reply: Jeff 'Japhy' Pinyan: "Re: print to both STDOUT and a file?"
- Maybe reply: Brian Volk: "RE: print to both STDOUT and a file?"
- Maybe reply: Brian Volk: "RE: print to both STDOUT and a file?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Maurice Lucas: "howto 'cat file|grep "foo bar"|wc -l' in perl"
- Previous message: Randy W. Sims: "Re: sort by extension"
- Next in thread: Chris Devers: "Re: print to both STDOUT and a file?"
- Reply: Chris Devers: "Re: print to both STDOUT and a file?"
- Reply: Jeff 'Japhy' Pinyan: "Re: print to both STDOUT and a file?"
- Maybe reply: Brian Volk: "RE: print to both STDOUT and a file?"
- Maybe reply: Brian Volk: "RE: print to both STDOUT and a file?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]