# typo here ------v :-) for ( 0..$#{$self->session->param('item'}} ) { print $self->session->param('item')->[$_]."\n"; }
means that you have as many calls to session->param as there are elements in the referenced array (apart from the first to get its last index). While impact on speed and program size is minimal, it feels somehow convoluted; taking a reference and iterating over that is cheaper and feels cleaner.
--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}
In reply to Re^2: Finding size of an array in an HoA
by shmem
in thread Finding size of an array in an HoA
by bradcathey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |