for my $a_id ( 0 .. $#list ) { $list[$a_id]=$indx; print " $list[$a_id]\t"; }