Otherwise, perhaps it's a setter:
if ($AUTOLOAD =~ /::set_(\w+)$/ and grep $1 eq $_, @elements) {
my $field = ucfirst $1;
{
no strict 'refs';
*{$AUTOLOAD} = sub { $_[0]->{$field} = $_[1] };
}
goto &{$AUTOLOAD};
}
If it is neither, death awaits:
die "$_[0] does not understand $method\n";
}