use strict; use Carp 'croak'; sub AUTOLOAD { my($name) = $::AUTOLOAD =~ /::([^:'_]+)_$/; my $method = __PACKAGE__->can($name) || croak "Undefined subroutine &$::AUTOLOAD called"; no strict 'refs'; goto &{ *$name = $method }; } sub foo { print "got: @_\n" } foo_(qw/ some args/); __output__ got: some args
_________
broquaint
In reply to Re: Strict and runtime sub names
by broquaint
in thread Strict and runtime sub names
by Scarborough
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |