Digioso has asked for the wisdom of the Perl Monks concerning the following question:
Now I could simply do:use strict; use warnings; sub blubb($) { my $array_ref = shift; for(my $i = 0; $i <= $#$array_ref; ++$i) { print "$i $array_ref->[$i]\n"; } } my @array = (1, 2, 3); blubb(\@array);
My question is: Is there a way to do this without @array2 ?my @array2 = reverse @array; blubb(\@array2);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Create reference to sorted anonymous array
by choroba (Cardinal) on Mar 16, 2016 at 14:32 UTC | |
by Digioso (Sexton) on Mar 16, 2016 at 14:54 UTC | |
|
Re: Create reference to sorted anonymous array
by Marshall (Canon) on Mar 17, 2016 at 00:48 UTC | |
by Digioso (Sexton) on Mar 17, 2016 at 13:42 UTC | |
by choroba (Cardinal) on Mar 17, 2016 at 17:01 UTC | |
by AnomalousMonk (Archbishop) on Mar 17, 2016 at 18:45 UTC | |
by Digioso (Sexton) on Mar 18, 2016 at 09:40 UTC | |
by AnomalousMonk (Archbishop) on Mar 18, 2016 at 12:08 UTC | |
| |
by Marshall (Canon) on Mar 18, 2016 at 21:40 UTC |