Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Check if "System" was succesful

by arden (Curate)
on Apr 09, 2004 at 13:42 UTC ( #343904=note: print w/replies, xml ) Need Help??


in reply to Check if "System" was succesful

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://343904]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2020-12-04 12:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (58 votes). Check out past polls.

    Notices?