Subject: | to_field() - $class instead of $self? |
Date: | Mon, 25 Sep 2006 16:00:59 +1000 |
To: | bug-Class-DBI-AsForm [...] rt.cpan.org |
From: | "An Chi Chen" <anchi.chen [...] gmail.com> |
Hi,
Could you kindly clarify the following for me please?
Should the RETURN statement inside the IF statement read
*"return $self->$meth($field); "*
instead of
*"return $class->$meth($field);" *?
*That is:*
sub to_field {
my ($self, $field, $how) = @_;
my $class = ref $self || $self;
if ($how and $how =~ /^(text(area|field)|select)$/) {
no strict 'refs';
my $meth = "_to_$how";
#============================================================
* return $class->$meth($field); # <------ should be $self instead of
$class? *
#============================================================
}
...
...
}
Thank you
An Chi