Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Monks, I'm seeing some very odd behavior I think might be a bug (in Moose?) but maybe I'm missing something more basic. So I've got this line of code:
$event is an object created with Moose, polished_data is an attribute and isa HashRef. $event->start_time is a Time::Piece object. Yes, I am copying the Time::Piece from one part of the object to another. Here's where the weirdness comes in. After the assignment, when I Dumper the event, sometime the value indexed by the start is the Time::Piece object and and the value of $event->start_time looks like this: $VAR1->{'polished_data'}{'start'}. What's really weird is the rest of the time (about 50% of the time), $event->start_time is the Time::Piece object and the indexed value in the hash is $VAR1->{'polished_data'}{'start'}. Witness:
If anyone can explain what's going on and help me workaround this issue, I'd greatly appreciate it.
$PM = "Perl Monk's"; In reply to Very odd behavior assigning Time::Piece object to hash reference inside of an object by nysus
|
|