I've not seen this suggested yet:
I've used this a few times in the past to generate repetitive object accessors/mutators.{ no strict qw(refs); foreach my $method ( keys %{ $self->{'data'} } ) { *{$method} = sub { my ( $self ) = @_; return $self->{'data'}->{$method}; }; } }
Cheers, Tim
Update: I beg your pardon, snoopy beat me to it :-)
In reply to Re: a simple matter of elegance
by tfrayner
in thread a simple matter of elegance
by spiros
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |