in reply to Re^6: out of memory problem
in thread out of memory problem

Changing the print loop to:

for my $key (keys %mappings) { for (keys %{$mappings{$key}}) { next if $mappings{$key}{$_} < 2; print "$key - $mappings{$key}{$_} -> $_\n" ; } }

Prints:

lung cancer - 2 -> some cancer cancer - 4 -> foot cancer

for the code I posted. Note that in the original code for keys %{$mappings{$key}} is a statement modifier and the if statement that you inserted is outside the inner loop so $_ is bogus. The code needed to be changed around into a full for loop so the condition can be checked inside the inner loop.


DWIM is Perl's answer to Gödel