in reply to Memory consumption
This statement is duplicating the entire hash:
my %hash = get_hash();
Instead of:
get_hash { my %hash; ## populate %hash; ... return %hash; } ... my %hash = get_hash(); ... if( defined( $hash{ $data[0] } ) ) {
Use:
get_hash { my %hash; ## populate %hash; ... return \%hash; } ... my $hashRef = get_hash(); ... if( defined( $hashRef->{ $data[0] } ) ) { ## Note the arrow .......^^
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Memory consumption
by pachkov (Novice) on May 06, 2009 at 10:01 UTC | |
by ELISHEVA (Prior) on May 06, 2009 at 10:50 UTC |