Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Note that system() returns a false value on success, so
system(...) or ... is the wrong idiom. Your code was succeeding, then printing out a suprious error.
perlfunc demonstrates the most comprehensive checking code: Note some further subtleties: since you are giving the command as a single string, it is executed by a shell, and you are actually checking the exit status of the shell rather than the command the shell is executing (although the shell normally returns the code of the last command it executed.) But as has been pointed out, use File::Copy. Dave. In reply to Re: Best method to capture return code from system calls?
by dave_the_m
|
|