in reply to a simple matter of elegance
Hi,
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 Section
Seekers of Perl Wisdom