Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I would like the error produced by the die to appear in STDERR and/or STDOUT, but can't seem to get it to work$logf="logfile"; select STDERR; $|=1; unless (open STDERR, "|-") { eval { open ERRLOG, ">$logf" or die "Can't open $logf: $!\n"; while(<>) { print ERRLOG $_; print STDERR $_; } }; exit(0);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: eval error
by phaylon (Curate) on Oct 18, 2005 at 15:25 UTC | |
|
Re: eval error
by Roy Johnson (Monsignor) on Oct 18, 2005 at 15:25 UTC | |
by Anonymous Monk on Oct 19, 2005 at 08:11 UTC | |
by Roy Johnson (Monsignor) on Oct 19, 2005 at 13:23 UTC | |
|
Re: eval error
by ioannis (Abbot) on Oct 18, 2005 at 20:26 UTC | |
by Anonymous Monk on Oct 19, 2005 at 08:52 UTC |