Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Printing a reference to the output of map

by mikeB (Friar)
on Dec 01, 2001 at 03:25 UTC ( #128788=note: print w/replies, xml ) Need Help??


in reply to Printing a reference to the output of map

maybe you want
print Dumper [map {$_ => get_day_name($_)} <DATA>];
map returns a list. The []'s return a reference to an anonymous array created from that list.

Update I should have read the question more closely. He does want a hash back. See clintp's response.

Replies are listed 'Best First'.
Re: Re: Printing a reference to the output of map
by clintp (Curate) on Dec 01, 2001 at 03:30 UTC
    map's returning a list all right: in this case a list of paired elements. It's perfectly acceptable to dump this "list" directly into a hash.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2022-01-25 15:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (67 votes). Check out past polls.

    Notices?