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

Re: Different behaviour of 'stat' function after assignment to $! (errno).

by SimonClinch (Chaplain)
on May 24, 2011 at 14:49 UTC ( #906506=note: print w/ replies, xml ) Need Help??


in reply to Different behaviour of 'stat' function after assignment to $! (errno).

$! is the extended O/S error. It isn't intended to be written to. Perl tends to be quite a permissive language. But if Perl lends you a loaded gun, is it Perl's fault if you aim at your foot and pull the trigger?

One world, one people


Comment on Re: Different behaviour of 'stat' function after assignment to $! (errno).
Re^2: Different behaviour of 'stat' function after assignment to $! (errno).
by muxxum (Initiate) on May 24, 2011 at 15:45 UTC
    Well, when -$! is not the same as 0-$! then I'd say that it's open to discussion. ;)
      I was addressing assigning to it as being the main issue, but I wouldn't negate it either as a general rule, because it certainly doesn't have to be numeric.

      One world, one people

        If that were the case, then $ERRNO should not say
        If used numerically, yields the current value of the C errno variable
        and
        You can assign a number to $! to set errno
        The OP did nothing unreasonable. ikegami has settled the matter, in my opinion. It was a bug, it has been fixed.
Re^2: Different behaviour of 'stat' function after assignment to $! (errno).
by ikegami (Pope) on May 24, 2011 at 17:10 UTC

    Writing to errno both directly and via $! aren't new, and there's no need to avoid doing so.

    $ perl -E'say $!=2' No such file or directory $ perl -E'say $!=3' No such process $ perl -E'say $!=4' Interrupted system call

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2014-10-23 09:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (125 votes), past polls