in reply to Re^2: More efficient dereferencing of a subroutine return
in thread More efficient dereferencing of a subroutine return
I was trying many variations of the below, but none work properly, and it just doesn't seem like a good thing to do. Should I stop trying to shorten this code and simply stick with the above?my ($ref1, $ref2) = retarrayrefs(); my @arr1=@$ref1; my @arr2=@$ref2; sub retarrayrefs { my @arr1=qw(one two three); my @arr2=qw(four five six seven); return (\@arr1,\@arr2); }
my (@arr1,@arr2) = ( ${retarrays()[0]}, ${retarrays()[1]} );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: More efficient dereferencing of a subroutine return
by BrowserUk (Patriarch) on Feb 19, 2013 at 18:22 UTC | |
by AnomalousMonk (Archbishop) on Feb 19, 2013 at 23:26 UTC | |
by gg48gg (Sexton) on Feb 20, 2013 at 19:49 UTC |