in reply to Tied %SIG
I can't guess why you think that your other methods should work. STORE methods do not set values by returning a value nor by overwriting the $key parameter.
Now, if you get anything to work, consider yourself lucky and worry about in what release of Perl it will break. %SIG is magical (yes, that is the real term for it). So when you set values of %SIG, C code inside of Perl gets run in order to set up actual signal handlers. What triggers this C code is called "magic" and you'll have to go read "perldoc perlguts" (and then some) if you want to know more about it.
If I were going to try this, I'd keep a reference to the original %SIG handy and then replace %SIG with my tied hash:
which I have some hope would separate the magic from the tiedness. But I can't offer any guarantees.my $realSig= \%::SIG; *::SIG= {}; tie %::SIG, ...
(I don't know if the "::"s are of any use in the above code. The "SIG" is special to Perl such that it knows to always find it in package "main", but I'm not certain that this specialness would always be triggered in the above code so I'm trying not to rely upon it.)
- tye (but my friends call me "Tye")
|
---|
Replies are listed 'Best First'. | |
---|---|
(bbfu) Re: (tye)Re: Tied %SIG
by bbfu (Curate) on May 01, 2001 at 01:22 UTC | |
by tye (Sage) on May 01, 2001 at 01:41 UTC | |
by bbfu (Curate) on May 01, 2001 at 01:50 UTC | |
by tye (Sage) on May 01, 2001 at 01:58 UTC | |
by bbfu (Curate) on May 01, 2001 at 02:06 UTC |