From 7f3028cbdb9eda2735027cd5e3f405a707b94cef Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Wed, 2 Mar 2022 22:11:56 +0000 Subject: [PATCH] more tolerant of weird subname calls in autoload --- lib/SNMP/Info.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/SNMP/Info.pm b/lib/SNMP/Info.pm index 800ef31f..ab9e1c22 100644 --- a/lib/SNMP/Info.pm +++ b/lib/SNMP/Info.pm @@ -5132,9 +5132,9 @@ subclass. sub AUTOLOAD { my $self = shift; - my ($sub_name) = $AUTOLOAD =~ /::(\w+)$/; + my ($sub_name) = $AUTOLOAD =~ /::([a-zA-Z0-9_-]+)$/; - return if $sub_name eq 'CARP_TRACE'; + return if $sub_name eq 'CARP_TRACE'; # Typos in function calls in SNMP::Info subclasses turn into # AUTOLOAD requests for non-methods. While this is deprecated,