From d6959f5c125a4785f0831f4c927cdf44069beb31 Mon Sep 17 00:00:00 2001 From: James Raspass Date: Wed, 22 Feb 2023 05:15:17 +0000 Subject: [PATCH] warnings::register - simplify use of caller caller in scalar context does much less work so not only is this easier to read, it should be a tad faster. And for good measure, switch to the modern version declaration while bumping. --- lib/warnings/register.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/warnings/register.pm b/lib/warnings/register.pm index 0adf104af7e0..8bcb7a233e0d 100644 --- a/lib/warnings/register.pm +++ b/lib/warnings/register.pm @@ -1,6 +1,5 @@ -package warnings::register; +package warnings::register 1.05; -our $VERSION = '1.04'; require warnings; # left here as cruft in case other users were using this undocumented routine @@ -19,7 +18,7 @@ sub import shift; my @categories = @_; - my $package = (caller(0))[0]; + my $package = caller; warnings::register_categories($package); warnings::register_categories($package . "::$_") for @categories;