Subject: | Fields not accessible in automethods |
All tests in 14-auto_cc.t fail for me, using Perl 5.6.1 on a FC3 machine (obviously, not the perl installation provided by the OS.) I've investigated the first test in that file and produced a minimalist example of the problem. Interestingly, if you uncomment the only commented line, the problem disappears.
use strict;
use warnings;
package My::Info; {
use Object::InsideOut;
my @info :Field('Accessor' => 'info');
sub auto : Automethod
{
my $self = $_[0];
my $class = ref($self) || $self;
my $name = $_;
# print STDERR \@info, "\n";
$DB::single=1;
return sub {
print STDERR \@info, "\n";
my $self = $_[0];
return join(',', $$self, $name, $info[$$self], $self->info);
};
}
sub static
{
my $self = $_[0];
print STDERR \@info, "\n";
return join(',', $$self, 'flog', $info[$$self], $self->info );
}
}
package main;
MAIN:
{
my $obj = My::Info->new();
$obj->info('test');
print(join("\n", $obj->static() ), "\n\n");
my @results = $obj->flog();
print(join("\n", @results), "\n\n");
print(join("\n", $obj->static() ), "\n\n");
}
exit(0);