Also sprach Ala Qumsieh:
> Vito Corleone wrote:
>
>> if ($cmd eq "get") { $self->get(); }
>> elsif ($cmd eq "set") { $self->set(); }
>> elsif ($cmd eq "copy") { $self->copy(); }
>
> Perl allows this:
>
> $self->$cmd;
And in case $cmd can contain garbage (that is, the name of a
non-existing method), one could catch that with an autoloader:
our $AUTOLOAD;
...
sub DESTROY { }
sub AUTOLOAD {
die "No such method: $AUTOLOAD";
}
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus}) !JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexi ixesixeseg;y~\n~~dddd;eval
|