Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.
This was fun. Calls to $self->_initialize exposed a nasty bug. There's enough context below for you to see it.
sub _initialize {
my $self = shift;
$self->SUPER::_initialize;
my $description = $self->{description};
$self->{$_} = [] foreach $self->_can_contain;
while ( my ( $type, $class ) = each %{ $self->_item_classes } ) {
my $source = $self->source;
foreach my $metadata ( @{ $description->{$type} } ) {
push @{ $self->{$type} } =>
$class->new_from_metadata( {
metadata => $metadata,
source => $source,
} );
}
}
}
sub _item_classes {
my $self = shift;
my %class_for = (
attributes => 'Bermuda::Island::Attribute',
elements => 'Bermuda::Island::Element',
);
my %item_classes;
foreach my $type ( $self->_can_contain ) {
$item_classes{$type} = $class_for{$type};
}
return \%item_classes;
}
sub _can_contain { qw/ attributes elements / }
Nice... :) (Score:1)
my %h = (
foo => 1,
bar => 2,
);
return \%h;
}
while (my ($k, $v) = %{ href() }) {
print "$k => $v\n";
}
Bingo! (Score:2)
Wow. People usually spot it sooner than this. Looks like I had a bit of stumper on this one. Good work :)