my @a; $a[1] = undef; $a[2] = 0; $a[3] = 7; #### use v5.12; use warnings; my (@x,%x); my $i=1; for my $v (undef,0,7) { $x[$i]=$x{$i}=$v; $i++; } #### --- Index exists? $i @x %x 0 1 1 1 2 1 1 3 1 1 4
## use v5.12; use warnings; my (@x,%x); my $i=1; for my $v (undef,0,7) { $x[$i]=$x{$i}=$v; $i++; } ##
## --- Index exists? $i @x %x 0 1 1 1 2 1 1 3 1 1 4