in reply to Error output to screen
File::Copy calls croak when an error happens. The easiest way to prevent croak from outputting to STDERR is to wrap the call in an eval:
eval { copy($fileOne,$fileTwo); }; if( $@ ) { die "Did not copy: $@"; }
Update: then again ... since you've re-opened STDERR to a file and since croak calls die and die outs to STDERR ... there's really no need for any of this (unless your platform does something funky when re-opening STDERR).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Error output to screen
by Anonymous Monk on Aug 01, 2006 at 14:28 UTC |