There may not be any good way to say this, but I'll take a stab at it.
When using my within a subroutine, it seems that the subroutine cannot share modified variable values with other subroutines unless the other subroutine is defined within the sub containing the my scoped valiable. Likewise, the my scoped value is not shared with the parent block unless the sub returns the value to the containing scope so that the desired modifications can be made. local is similar, but while the block where a local variable is defined or redefined is being parsed any subs that it triggers get to use the local value. If it were my variable then the subs would have whatever value they inherit from their own parent scope. If the variable is defined in the same block as the subroutines then my and local are effectively the same because the local scope is active as long as the subs are being defined and the subs inherit from my scope.
In reply to Re^4: Is use strict always appropriate?
by Anonymous Monk
in thread Please help me print this hash.
by Je55eah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |