Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Weird use warnings FATAL behavior (expected)

by tye (Cardinal)
on Mar 18, 2008 at 06:05 UTC ( #674716=note: print w/ replies, xml ) Need Help??


in reply to Re: Weird use warnings FATAL behavior
in thread Weird use warnings FATAL behavior

It looks like the child process tries to warn which gets turned into a die which gets caught by the eval and thus causes the child to continue on to the line after the eval instead of doing what it was planning to do after it warned.

Not really that much of a surprise, IMHO, since you told it to do all of those things.

Then the parent doesn't get tricky notice of the child being unable to exec (since you forced the child to get side-tracked) so open succeeds and the parent continues on from there.

One bug is that $$ doesn't get updated since the forked code isn't expected to survive long enough to be able to run any Perl code that uses $$, so trying to report $$ just confuses things.

- tye        


Comment on Re^2: Weird use warnings FATAL behavior (expected)
Select or Download Code
Re^3: Weird use warnings FATAL behavior (expected)
by ikegami (Pope) on Mar 18, 2008 at 06:59 UTC

    One bug is that $$ doesn't get updated since the forked code isn't expected to survive long enough to be able to run any Perl code that uses $$

    aha! The last bit of the puzzle. I assumed reading $$ translated into a system call to fetch the PID. It never occured to me it might not be accurate.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2014-09-17 08:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (68 votes), past polls