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

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! :)


Comment on Re: qx and $!
Download Code
Replies are listed 'Best First'.
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?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2015-11-29 11:35 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (750 votes), past polls