in reply to Memory efficiency, anonymous vs named's vs local subroutines
But why do you want nested subs in the first place? You're not making closures, right? One common way to get "private" helper subs in your module is:
sub something_useful { my $x = _helper(shift); return $x; } sub _helper { ... }
One major advantage is in testing: the helper subs can be called directly.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Memory efficiency, anonymous vs named's vs local subroutines
by thanos1983 (Parson) on Jul 18, 2015 at 18:56 UTC |