Help for this page
my %hash; populate_hash(%hash); ... my %h = @_; # Makes a COPY of the paramter %h= (k1=>'v1', k2=>'v2); # Populates the LOCAL %h, not '%hash' }
my %hash = populate_hash( ); # Option 1: Use the Return value ... my ($href) = @_; # Makes a COPY of the reference $href= {k1=>'v1', k2=>'v2}; # Notice - using CURLY brackets, not par +ens. This creates a Hash ref. }