in reply to Passing Reference of a Hash to a method

my $hRef=@_;
That should be
my ($hRef)=@_;
An array in scalar context returns the number of elements, not the first element.

Dave.