Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

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


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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2018-05-26 22:24 GMT
Find Nodes?
    Voting Booth?