You are right that the specific code example I gave only works for $_. But some variant of the trap works on any global variable that is normally assumed to be in package main no matter what package you are in. Like @_, %ENV, or %SIG.
In any case this is an example of why it is better to have a precise understanding of how features work rather than having a vague impression that is going to mostly work, most of the time.
In reply to Re^8: the "our" declaration ?!!
by tilly
in thread the "our" declaration ?!!
by perlpal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |