Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Check if "System" was succesful

by arden (Curate)
on Apr 09, 2004 at 13:42 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://343904]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-03-28 17:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found