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

Re: qx and $!

by liverpole (Monsignor)
on Oct 18, 2006 at 15:38 UTC ( #579117=note: print w/ replies, xml ) Need Help??


in reply to qx and $!

Hi asarih,

If you read perlvar, you'll see about $!:

If used numerically, yields the current value of the C "errno" variable, or in other words, if a system or library call fails, it sets this variable. This means that the value of $! is meaningful only immediately after a failure:

For your purposes, the key phrase is "meaningful only immediately after a failure".

So you're trying to attach meaning to something that isn't useful in this case (ie. the value of errno).

Update:  Hey, no fair davorg!  You clearly have the perldocs memorized, whereas I had to go look it up; that's why you beat my answer! :)


s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/


Comment on Re: qx and $!
Download Code
Re^2: qx and $!
by blazar (Canon) on Oct 18, 2006 at 16:19 UTC
    Update: Hey, no fair davorg! You clearly have the perldocs memorized, whereas I had to go look it up; that's why you beat my answer! :)

    It's not fair only if you assume that there's a competition going on, at who answers the first - although I admit I like to be the one myself, on occasions. Otherwise, repetita iuvant. (Latin idiomatic expression which means "repetitions help".) Well, if taken in non excessive doses, cum grano salis...

Re^2: qx and $!
by bart (Canon) on Oct 18, 2006 at 18:38 UTC
    Note that a "system call" is not a call of system — or qx! Instead, it's a call of a call of an OS implemented function.

    Errors on those command lines usually send their error messages to STDERR, and also may set "errorlevel" (as it's known in DOS), aka the last program's exit code, which you can read through $? (child error) after some calculation.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2014-09-15 02:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (145 votes), past polls