sub my_func{ my ( $self, $ptr_array, $value ) = @_; my $look_right = sub {... [uses $value and $ptr_array] } my $look_left = sub {... [uses $value and $ptr_array] } return $look_right->() if ( $value == 0 ); return $look_left->() if ( $value == @{ $ptr_array } ); return ( $look_right->() && $look_left->() ); }
In reply to Re: My Confusion
by borisz
in thread Nested subroutines and access to variables in an outer scope
by PerlingTheUK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |