in reply to Index of Items in Array using foreach loop
Yes - use the for loop:
for( my $Arrayindex = 0; $Arrayindex <= ( $#SampleArray ); $Arrayindex +++ ) { print $SampleArray[ $Arrayindex ] , ' is at location ' , $Arr +ayindex , ' in the array' , "\n"; }
|
---|
In Section
Seekers of Perl Wisdom