Is there a way to avoid this multi step operation when I have multiple return values of a sub?
Yes:
sub fillArrays { my( $r1, $r2 ) = @_; my @$r1 = qw(one two three); my @$r2 = qw(four five six seven); return; } my (@arr1,@arr2); fillArrays( \@arr1, \@arr2 );
In reply to Re^4: More efficient dereferencing of a subroutine return
by BrowserUk
in thread More efficient dereferencing of a subroutine return
by gg48gg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |