in reply to Re: Passing hashes to sub
in thread Passing hashes to sub

In both the OPed code and in huck's reply:

my $ComResult={sidStatComp($prevsidstat,$cursidstat)}; ... sub sidStatComp { ... return 1; }
This tries to build the anonymous hash  { 1 } (update: a reference to which is assigned to $ComResult, which is never used) that Perl is, I think, warning about. (BTW: Kudos to PSP for using warnings — and I hope strict! OTOH, it would have been nice if PSP could have pointed out which line in the posted code was line 65.)

Update: Code examples:

c:\@Work\Perl\monks>perl -Mstrict -MData::Dump -e "my $x = { 1 }; dd $x; " { 1 => undef } c:\@Work\Perl\monks>perl -Mstrict -Mwarnings -MData::Dump -e "my $x = { 1 }; dd $x; " Odd number of elements in anonymous hash at -e line 1. { 1 => undef }


Give a man a fish:  <%-{-{-{-<