Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I had things working and then decided to break this program into 3 parts. The 1st part had a jump-table, of sorts, where a bunch of anon subs were called depending on what keyword matched. Some were named because they were reused by other routines.
When I turned the 1st part into its own package, the call to the subs via the "local" name, stopped working. Created 2 call types in a test. asub can only be called if I don't declare it w/local -- Can't I declare it? bsub is local to a procedure, for it, the local call has no effect (bsub is callable from within "do_internal_sub" either way. Oddly, even though the "local *bsub" would seem to include "stuff" in its lexical scope, instead of the eval telling me that bsub was not set, it says it can't find bsub. So why does the "local *bsub" have no effect and why does the inclusion of "local *asub" prevent it from being callable in "stuff", below?
P.s - Obviously, I can hack together something that will work, but there sure seem to a few inconsistencies which always tend to bug me... Thanks! In reply to how to declare a local *subname=sub{}? by perl-diddler
|
|