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).
In reply to Re: Error output to screen
by derby
in thread Error output to screen
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |