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

Re^2: Creating hash: Key is unique string in array element, value is number of times it appears

by johngg (Canon)
on Oct 26, 2011 at 11:06 UTC ( [id://933862]=note: print w/replies, xml ) Need Help??


in reply to Re: Creating hash: Key is unique string in array element, value is number of times it appears
in thread Creating hash: Key is unique string in array element, value is number of times it appears

%genus = { } ; #genus is empty

Let's try that!

knoppix@Microknoppix:~$ perl -Mstrict -wE 'my %genus = {};' Reference found where even-sized list expected at -e line 1. knoppix@Microknoppix:~$

You probably meant to use parentheses rather than curly braces, which construct a reference to an anonymous hash.

knoppix@Microknoppix:~$ perl -Mstrict -wE 'my %genus = ();' knoppix@Microknoppix:~$

I hope this is helpful.

Cheers,

JohnGG

  • Comment on Re^2: Creating hash: Key is unique string in array element, value is number of times it appears
  • Select or Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-25 19:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found