Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Run Linux Command from Perl Script

by kyle (Abbot)
on Mar 23, 2007 at 14:08 UTC ( [id://606244]=note: print w/replies, xml ) Need Help??


in reply to Run Linux Command from Perl Script

Have a look at the documentation for system. Unlike virtually everything else, it returns non-zero for failure, so where you say "system || print "error"", you need to have something more like:

system( "sh $temp_shell2" ) == 0 or die "2 failed to execute: $!";

I think right now it's telling you that it fails when it's not.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-19 17:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found