Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have successfully backed up my data file using:
copy("applicants.txt","$targetfile") or die "Copy failed: $!";I have read that copy, or any function, returns 1 upon success, 0 upon failure. I wish to test for success or failure without user resorting to the log file. I would expect something simple like:
if (whatever == 1) { do something; }I have researched the archive and google without success in answering this. Please respond with code example, as I'm a newbie. Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Testing Return Values
by toolic (Bishop) on Jun 05, 2013 at 15:08 UTC | |
by Anonymous Monk on Jun 05, 2013 at 17:17 UTC | |
|
Re: Testing Return Values
by davido (Cardinal) on Jun 05, 2013 at 15:20 UTC | |
|
Re: Testing Return Values
by Anonymous Monk on Jun 05, 2013 at 16:32 UTC |