die "No such method $AUTOLOAD. Barfing\n" unless exists $self->{$field}; if ($self->{$field}{editable}) { *$AUTOLOAD = eval <<ENDSUB; sub { my \$self = shift; \$self->{$field}{value} = shift if \@_; \$self->{$field}{value}; } ENDSUB } else { *$AUTOLOAD = eval <<ENDSUB2; sub { my \$self = shift; die "Can't modify readonly field '$field'" if \@_; \$self->{$field}{value}; } ENDSUB2 } goto &$AUTOLOAD;
--
I'm Not Just Another Perl Hacker
In reply to Re^3: Subroutines with differing behaviour created from AUTOLOAD
by rinceWind
in thread Subroutines with differing behaviour created from AUTOLOAD
by davis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |