in reply to Re: re-initialize the hash
in thread re-initialize the hash

sub inithash { my $h= shift; $h= { 'a'=>0, ... }; #note the curled braces %$h= ( 'a'=>0, ... ); #alternative to the previous line }

The first of these methods, i.e.
    $h= { 'a'=>0, ... };
does not work:

>perl -wMstrict -le "use Data::Dumper; my %hash = qw(a 1 b 2 c 3); print Dumper \%hash; init(\%hash); print Dumper \%hash; sub init { my $h = shift; $h = { foo => 'bar' }; } " $VAR1 = { 'c' => '3', 'a' => '1', 'b' => '2' }; $VAR1 = { 'c' => '3', 'a' => '1', 'b' => '2' };