Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Problem with AUTOLOAD and Windows ($!)

by tye (Sage)
on Nov 23, 2011 at 16:37 UTC ( #939696=note: print w/replies, xml ) Need Help??


in reply to Problem with AUTOLOAD and Windows

There are tons of things that can set $!, many of which are not evident on the Perl script. If you are going to check for $! being 0 or not, then you need to set $! to 0 immediately before the code that might set $! and check $! immediately after calling that code.

It isn't terribly surprising that $! was often left at 0 on previous runs. It also isn't terribly surprising that $! wasn't left at 0 on a recent run.

So make two fixes to your AUTOLOAD code. Add $! = 0; right before you call the XS code. Don't even look at $! unless the XS code returns 0.

- tye        

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://939696]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2018-01-18 02:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (206 votes). Check out past polls.

    Notices?