Skip to content

Commit

Permalink
warnings::register - simplify use of caller
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JRaspass authored and demerphq committed Feb 22, 2023
1 parent db08a4e commit d6959f5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions 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
Expand All @@ -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;
Expand Down

0 comments on commit d6959f5

Please sign in to comment.