in reply to Optimizing Memory consumption

In a similar situation, I saved memory by avoiding unintentional auto-vivification of nested hash structures. That helped a lot, since checking if $foo->{bar}->{baz}->[0] is true will create a hash and an array if they didn't exist already. Careful use of exists() can avoid this. Ultimately though, I had to switch to a more sensible system that didn't try to load all the data into RAM at once.