in reply to Redirection of output
For your second try, what you want is:
This is documented in perldoc -f open.open(OUTPUT,">&STDOUT") or die "couldn't dup stdout: $!";
You can also accomplish what you want with the one-argument form of select. See perldoc -f select.
But I'm not sure why your first attempt won't work. This works fine for me:
#!/usr/bin/perl open(STDOUT,">/tmp/tempfile.html") or die "open: $!"; foreach my $i (1..10) { print $i,"\n"; }
Can you reduce your program to a smaller testcase and see if you can still reproduce the problem? Or can you reproduce the problem from the command-line and see what's going on?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Redirection of output
by michellem (Friar) on Sep 09, 2003 at 18:21 UTC |