achang27 achang27 - 11 months ago 33
Perl Question

Perl AUTOLOAD - get name of unknown method without class name

I am writing an

method for a Perl class.

I can get the name of the unknown method with

$name = $ExampleClass::AUTOLOAD;

However this gets me the full identifier:

I just need
. How can I only get that portion of the name?

Answer Source
( my $method_name = our $AUTOLOAD ) =~ s/^.*:://s;


my $method_name = our $AUTOLOAD =~ s/^.*:://sr;    # 5.14+
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download