Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Evil bug: map + anony hash

by PodMaster (Abbot)
on Sep 24, 2002 at 05:33 UTC ( [id://200300]=note: print w/replies, xml ) Need Help??


in reply to Evil bug: map + anony hash

Works fine for me.
package Car; sub new { bless {},shift }; sub title { 'BITTER' }; sub descr { 'BUTTER' }; sub F { ( Car->new, Car->new, Car->new, Car->new ) }; package main; print map{{title=>$_->title(),desc=>$_->descr()}} Car->F(); use Data::Dumper; die Dumper map{{title=>$_->title(),desc=>$_->descr()}} Car->F(); __END__ HASH(0x1ab51f0)HASH(0x1ab5280)HASH(0x1ab5310)HASH(0x1ab53a0)$VAR1 = { 'title' => 'BITTER', 'desc' => 'BUTTER' }; $VAR2 = { 'title' => 'BITTER', 'desc' => 'BUTTER' }; $VAR3 = { 'title' => 'BITTER', 'desc' => 'BUTTER' }; $VAR4 = { 'title' => 'BITTER', 'desc' => 'BUTTER' };
You should take the mystery out of the questions when you can (like with this Chars->get business).

What makes a bad question? Before You Post ... How (Not) To Ask A Question How to ask questions the smart way

____________________________________________________
** The Third rule of perl club is a statement of fact: pod is sexy.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-24 08:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found