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

Re: How to create hash out of an array elements?

by CountZero (Bishop)
on Nov 17, 2011 at 10:47 UTC ( #938586=note: print w/ replies, xml ) Need Help??


in reply to How to create hash out of an array elements?

This works:

use Modern::Perl; my %sizes = ('function' => 100, 'another function' => 200); say "The size of function is $sizes{'function'}";
Output:
The size of function is 100

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James


Comment on Re: How to create hash out of an array elements?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2014-11-22 09:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (121 votes), past polls