Not exactly. It would probably help to read Coping With Scoping. A lexical variable (declared with my) can be seen outwards to the nearest enclosing scope. When you invoke a sub and want to have some variables visible to that sub, you need to pass them to the sub as arguments. The alternative is to declare your lexicals at the same scope as the subs themselves. This is unlikely the right solution.
Cheers - L~R
In reply to Re: nested Subroutines and my var
by Limbic~Region
in thread nested Subroutines and my var
by KaiAllard
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |