Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: (jeffa) Re: Refactor method calls or not?

by japhy (Canon)
on Jan 19, 2002 at 00:35 UTC ( #139943=note: print w/replies, xml ) Need Help??


in reply to (jeffa) Re: Refactor method calls or not?
in thread Refactor method calls or not?

The corollary to that, which uses autoloading, is:
{ my %calls = qw( company company financial_diary financialDiary ); AUTOLOAD { my ($meth) = $AUTOLOAD =~ /.*::(.*)/; if (my $table = $calls{$meth}) { *{"add_$meth"} = sub { my $self = shift; $self->gen_add($table, @_); }; goto &{"add_$meth"}; } require Carp; Carp::croak "Unknown table action '$meth'"; } }

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://139943]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2021-04-23 00:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?