![]() |
|
go ahead... be a heretic | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
1. This dirty bit of nastiness appears to do what you want:
..but why on earth do you want to do this? :) This kind of magic side-effect can cause incredibly hard-to-diagnose bugs: someone might move the subroutine call into another package, never suspecting that it might vary it's behaviour based on something as oblique as compiler directives in effect in the most-recent calling code. 2. Using $_ for callbacks is fine AFAIK, as long as you are careful and the callbacks are short. I've used things like hostname_cleanup => sub { s/test\.userfriendly\.org$//i } to pass regexps in from configuration files before I learned about qr//. I too will be interested to see what the real experts think!
In reply to Re: Callback Design
by saucepan
|
|