in reply to Re^2: Create reference to sorted anonymous array
in thread Create reference to sorted anonymous array
Further to choroba's reply: For even more complete completeness, if you're dealing with array references:
for my $element (@$arrayref) { print $element, "\n"; } for my $i (0 .. $#$arrayref) { print "$i: $arrayref->[$i]\n"; }
Update: Digioso: I quite agree with your preference for using explicitly named variables rather than default names (or none at all) in the interests of readability and maintainability. I disagree that the C-style for-loop serves these interests, quite apart from the lurking demon Offbyone.
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Create reference to sorted anonymous array
by Digioso (Sexton) on Mar 18, 2016 at 09:40 UTC | |
by AnomalousMonk (Archbishop) on Mar 18, 2016 at 12:08 UTC | |
by Digioso (Sexton) on Mar 18, 2016 at 12:30 UTC | |
by Your Mother (Archbishop) on Mar 18, 2016 at 13:24 UTC |