If $arr1 holds the name of the array, you can step through the array with
foreach my $x (0..$#{$arr1}) { if($arr1->[$x] eq $1){$found++} }
IMO loops like this are better written as
foreach my $x (@$arr1) { if ($x eq $1) {$found++} }
You might read up on references and their use in References
In reply to Re: Reading a array
by jethro
in thread Reading a array
by rsriram
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |