in reply to how can i get the index value of array during runtime
#!/usr/bin/perl use strict; use warnings; my @array =qw (34 56 78 9); for( my $i = 0; $i <= $#array; $i++ ) { print $i, " ", $array[$i], "\n"; }
update: Changed to $i <= $#array (thanks rminner).
|
|---|