in reply to Evil bug: map + anony hash
It might be a problem with $_ localization: look at line 3.
package Car; sub new { bless {},shift }; sub title { $_='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();
output:
Can't locate object method "descr" via package "title" (perhaps you forgot to load "title"?) at test.pl line 8.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Evil bug: map + anony hash
by BUU (Prior) on Sep 24, 2002 at 21:10 UTC | |
by diotalevi (Canon) on Sep 24, 2002 at 21:16 UTC | |
by BUU (Prior) on Sep 24, 2002 at 21:31 UTC |