|
|
| laziness, impatience, and hubris | |
| PerlMonks |
Re: Any one know how to use sigtrap with moose?by tobyink (Prior) |
| on Jul 24, 2012 at 10:20 UTC ( #983355=note: print w/ replies, xml ) | Need Help?? |
|
This bit:
... seems to be assuming that your handler will be called with two arguments, the second of which is an object. But if you read sigtrap which refers you to perlvar you'll see that for real signals (not Perl's internal __DIE__ and __WARN__ signals) the handler gets passed just one parameter: the name of the signal (e.g. "INT", "QUIT", etc). The fact that you're using Moose makes no difference here. What are you actually hoping to achieve? What's the overall reason you're installing a signal handler? If you explain that, then perhaps somebody can give you some advice about how to go about doing it.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||