foreach my $i ( 0 .. $#$array ) { # dereference the element print $array->[$i], "\n"; }
Originally posted as a Categorized Answer.
In reply to Re: How do I loop over a reference to an array?
by sdaniels
in thread How do I access an array for which I only have a reference?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |