Hi all,
Tried filing a ticket, but I don't see it in the queue. I'll refile if it
really is a bug. Haven't had time to debug it, but have a minimum test case.
The following code prints "2", as expected:
{
package MyBase;
sub foo { 1 }
}
{
package One;
use Moose;
extends qw{MyBase Moose::Object};
has counter => ( is => 'rw', isa => 'Int', default => 1 );
sub inc_counter {
my $self = shift;
$self->counter( $self->counter + 1 );
}
}
my $one = One->new;
$one->inc_counter;
print $one->counter, $/;
However, change the "extends" line to inherit from Pod::Parser:
extends qw{Pod::Parser Moose::Object};
That prints out:
Use of uninitialized value in addition (+) at inherit.pl line 16.
1
I've worked around this by adding a BUILD method to set those defaults, but if
I'm doing something silly, I'd love to know. This is Moose 0.92 with
Pod::Parser 1.35.
Cheers,
Ovid
--
Buy the book - http://www.oreilly.com/catalog/perlhks/
Tech blog - http://use.perl.org/~Ovid/journal/
Twitter - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6