Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Printing a reference to the output of map

by mikeB (Friar)
on Dec 01, 2001 at 03:25 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-19 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found