Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello Everyone,
Please see following code:
sub Clear{ my $item=$_[0]; $item=~s/^\s+//; $item=~s/\s+$//; return $item; } sub Txn_Extract{ my $name_of_file=$_[0]; my $hash_ref=$_[1]; $hash_ref=Clear($hash_ref); #Here something goes wrong. +When I remove this line %DATA_HASH gets populated properly. Need to k +now what happens when I clear the $hash_ref variable with above sub C +lear. my @row; . .. . . } sub Main { Txn_Extract (file.txt,\%DATA_HASH); print Dumper \%DATA_HASH }
OUTPUT: VAR{}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Understand why dumper printed null hash
by choroba (Cardinal) on Jun 12, 2012 at 10:11 UTC | |
|
Re: Understand why dumper printed null hash
by Anonymous Monk on Jun 12, 2012 at 10:06 UTC | |
by Anonymous Monk on Jun 12, 2012 at 18:21 UTC |