in reply to Not able to retrieve hash value outside the function

With the following line, you overwrite all contents of %hash:

%hash=@$row;

Most likely, you only wanted to add a single key/value pair to the hash?

my( $key, $value ) = @$row; $hash{ $key } = $value;

Replies are listed 'Best First'.
Re^2: Not able to retrieve hash value outside the function
by Anonymous Monk on Dec 22, 2015 at 04:21 UTC

    Thank you . The code suggested by you worked as per my requirement.