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{}
In reply to Understand why dumper printed null hash by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |