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

Re: Data::Diver polluting $!

by roboticus (Chancellor)
on Nov 01, 2012 at 12:23 UTC ( #1001814=note: print w/ replies, xml ) Need Help??


in reply to Data::Diver polluting $!

philkime:

The documentation, in the $! section, states:

$! 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...

A bit earlier, just after the Error Variables heading, it mentions that:

The variables $@, $!, $^E, and $? contain information about different types of error conditions ... They correspond to errors detected by the Perl interpreter, C library, operating system, or an external program, respectively.

So the long and short of it is that using the value of $! at any time other than just after a failed operation involving the C library is a bug.

...roboticus

When your only tool is a hammer, all problems look like your thumb.


Comment on Re: Data::Diver polluting $!
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2015-07-07 01:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (86 votes), past polls