in reply to Memory leak while printing ?? Don't think so....

Your memory problem probably comes from the fact that perl has a feature called autovivication:

perl -e 'use Data::Dumper; print $f[5][4][3]; print Dumper(\@f);' $VAR1 = [ undef, undef, undef, undef, undef, [ undef, undef, undef, undef, [] ] ];

Note that a lot of intermediate undef values are generated when all I do is access a value. It doesn't matter for the innermost array as you can see, but if your $row is some really high value, you can fill your memory quite fast.

If you don't want that, you could use a hash instead. Or maybe you just have a bug so that $row or $msmtable has a unnaturally high value