Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Long read!
(wont try it again! ;-) I don't understand why you're using feature qw(say) if you wanna redefine 'say. This makes say() a builtin which has to be overridden like described in perlsub#Overriding Built in Functions. Otherwise this works:
or even simpler:
OTOH you will certainly have problems if someone manages to globally switch say on. My suggestion is to replace say() with something like 'log()' or 'out()' and keep it simple, don't redefine the sub at all, just put the test condition into the function body.
Cheers Rolf In reply to Re: Redefining Imported Subs: of scope and no
by LanX
|
|