use Data::Dumper; my $x=[1, , ,2]; # This is NOT the same as $y !!!! my $y=[1,undef,undef,2]; print Dumper($x,$y); __END__ $VAR1 = [ 1, 2 ]; $VAR2 = [ 1, undef, undef, 2 ];