$ perl -le '$x=2**30; print $x; $a[$x]=0' 1073741824 Out of memory during array extend at -e line 1. #### @lines = ; # copy 1 $all = join("",@lines); # copy 2 for (@lines) { ($key,$val) = split " ", $_, 2; $hash{$key} = $val; # copy 3 }