?my sub foo {}
In other words, I want a subroutine within a subroutine that is invisible to every other subroutine in the same package. Specifically, I have a one-line helper routine that I'd like to have with the same name within many parent subroutines, using slight variations in each one. But if I do
then the second x()'s definition overrides the first one's.sub a { sub x {} } sub b { sub x {} }
Is the best way to do this by just having a subroutine reference at the package level, and assigning anonymous subroutines into it from inside a() and b()?
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |