The "inner" sub is actually visible to everyone.
$ perl -wE'sub o { sub i { say "foo"; } } i();' foo
The "inner" sub cannot use variables from the "outer" sub.
$ perl -wE'sub o { my ($x) = @_; sub i { say $x; } i(); } o("abc"); o( +"def");' Variable "$x" will not stay shared at -e line 1. abc abc
I tend to call what you have a bug, not a technique.
In reply to Re: Inner subroutines?
by ikegami
in thread Inner subroutines?
by wsppan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |