Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Passing hashes to sub

by AnomalousMonk (Archbishop)
on Jul 22, 2017 at 10:07 UTC ( [id://1195772]=note: print w/replies, xml ) Need Help??


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:  <%-{-{-{-<

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1195772]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-29 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found