in reply to A question of perlish elegance on array loop
You don't need the extra @{} In there. Just $#{ $array_ref } is what you want (or $#{ $obj->{ array_ref } } from your example).
Update: And seconded, unless you've got good reason to need the index for my $elem ( @{ $obj->{ array_ref } } ) { ... } is more idiomatic.
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A question of perlish elegance on array loop
by ait (Hermit) on Nov 30, 2007 at 00:44 UTC | |
by Fletch (Bishop) on Nov 30, 2007 at 00:52 UTC |