#!/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).
In reply to Re: how can i get the index value of array during runtime
by derby
in thread how can i get the index value of array during runtime
by phemal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |