P is for Practical | |
PerlMonks |
Re: Check if "System" was succesfulby arden (Curate) |
on Apr 09, 2004 at 13:42 UTC ( [id://343904]=note: print w/replies, xml ) | Need Help?? |
to get the return value of a system command, just do: my $returnValue = system(...); and determine if the code is what you want/expect.
Of course, in your specific example, why don't you just do a DOS MOVE instead of a COPY & unlink ? Again, you can capture the return codes from each move to put into a hash to know the number of files successfully and unsuccessfully moved (I'm assuming that's what you're using the $i++ for. - - arden.
In Section
Seekers of Perl Wisdom
|
|