in reply to Finding size of an array in an HoA
for (0.. $#{$self->session->param('item')} ) {
gives you the indices into the array in $_ . But you might want
for (@{$self->session->param('item')}) {
to iterate over the elements themselves (in $_).
You could as well take a reference to the array and use that:
my $ary = $self->session->param('item'); for (@$ary) { ... }
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Finding size of an array in an HoA
by bradcathey (Prior) on May 15, 2007 at 08:17 UTC |