perl -MData::Dumper -e "$hash{lvl1}[3]{lvl3}[0] = 42; print Dumper \%hash" $VAR1 = { 'lvl1' => [ undef, undef, undef, { 'lvl3' => [ 42 ] } ] };