Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Spooky actions from a signal handler possible?

by BrowserUk (Patriarch)
on Feb 24, 2015 at 19:51 UTC ( [id://1117712]=note: print w/replies, xml ) Need Help??


in reply to Spooky actions from a signal handler possible?

but neither changes to the object nor the %ENVironment seem to persist.

Hm. The second part of that is incorrect:

#! perl -slw use strict; $SIG{ INT } = sub { print 'SIGINT called'; $ENV{ fred } = 12345; return; }; $ENV{ fred } = 0; while( sleep 1 ) { print $ENV{ fred }; } __END__ C:\test>junk10 0 0 0 0 0 0 SIGINT called 12345 12345 12345 12345 12345 12345 12345 Terminating on signal SIGBREAK(21)

Which probably means that I've misunderstood your intent. Perhaps you could post some code to demonstrate the problem?


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

Replies are listed 'Best First'.
Re^2: Spooky actions from a signal handler possible?
by belg4mit (Prior) on Feb 24, 2015 at 20:30 UTC
    Apparently PIPE and INT are different. That works, but only if the code that triggers the PIPE is in a block eval. My code is a little hairy at the moment though, so coming up with a suitable example is proving tricky.

    --
    In Bob We Trust, All Others Bring Data.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-03-29 11:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found