solegaonkar has asked for the wisdom of the Perl Monks concerning the following question:
Update:: The problem was solved by using scope rather than delete/undef... Updated the code to the following and that performs much better!!my %map while (sysread(CSV, $record, 66)) { $map{substr($record, 18, 14)}->{substr($record, 3, 15)} = subs +tr($record, 36, 29); if ($count++ > 1000) { &process(); undef %map; } }
Thank you all for your help!!while (sysread(CSV, $record, 66)) { my %map my $count=0; $map{substr($record, 18, 14)}->{substr($record, 3, 15)} = substr($ +record, 36, 29); while (sysread(CSV, $record, 66)) { $map{substr($record, 18, 14)}->{substr($record, 3, 15)} = subs +tr($record, 36, 29); if ($count++ > 1000) { &process(\%map); last; } } &process }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Enforce Memory Cleanup
by Anonymous Monk on Jun 17, 2014 at 06:37 UTC | |
by solegaonkar (Beadle) on Jun 18, 2014 at 03:33 UTC | |
by Anonymous Monk on Jun 18, 2014 at 03:54 UTC | |
by solegaonkar (Beadle) on Jun 18, 2014 at 04:30 UTC | |
by davido (Cardinal) on Jun 18, 2014 at 05:27 UTC | |
|
Re: Enforce Memory Cleanup
by DrHyde (Prior) on Jun 17, 2014 at 11:42 UTC | |
by solegaonkar (Beadle) on Jun 18, 2014 at 03:34 UTC | |
|
Re: Enforce Memory Cleanup
by Theodore (Hermit) on Jun 17, 2014 at 15:16 UTC | |
by solegaonkar (Beadle) on Jun 18, 2014 at 03:37 UTC | |
|
Re: Enforce Memory Cleanup
by Laurent_R (Canon) on Jun 17, 2014 at 18:01 UTC | |
by solegaonkar (Beadle) on Jun 18, 2014 at 03:45 UTC |