Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Fix $? check

by dolmen (Beadle)
on May 23, 2014 at 08:55 UTC ( [id://1087181]=note: print w/replies, xml ) Need Help??


in reply to Inappropriate ioctl for device using Phi.pm on system call

First, never put execution permission on a .pm!

For the probable cause of your error, have a look at the manual for the "system" function (perldoc -f system):

If you'd like to manually inspect "system"'s failure, you can check all possible failure modes by inspecting $? like this:
                   if ($? == -1) {
                       print "failed to execute: $!\n";
                   }
                   elsif ($? & 127) {
                       printf "child died with signal %d, %s coredump\n",
                           ($? & 127),  ($? & 128) ? 'with' : 'without';
                   }
                   else {
                       printf "child exited with value %d\n", $? >> 8;
                   }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 22:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found