in reply to goto and AUTOLOADed methods
sub AUTOLOAD { no strict; (my $m = $AUTOLOAD) =~ s{.*::}(); *$m = make_method_here() if $m =~ /fulfils some condition/; croak "AUTOLOAD: can't access method $m"; unless defined *$m{CODE} and $_[0]->can($m); goto &$m; }
But as far as calling goto with a method name having left @_ intact, that nicely emulates a method call. The drawbacks would be that it'll be slow, and it's always a bit contentious dynamically creating/accessing methods via AUTOLOAD when quite often the likes of Class::Accessor will suffice (but as always, it's somewhat of a rule-of-thumb decision).
HTH
_________
broquaint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: goto and AUTOLOADed methods
by fergal (Chaplain) on Aug 01, 2003 at 11:50 UTC | |
by ctilmes (Vicar) on Aug 01, 2003 at 12:47 UTC | |
|
Re: Re: goto and AUTOLOADed methods
by ctilmes (Vicar) on Aug 01, 2003 at 11:22 UTC |