Skip to content

Commit

Permalink
Avoid inheriting from Exporter in Perl modules
Browse files Browse the repository at this point in the history
Just import the import function from Exporter instead of inheriting
from it. This works reliably with Perl 5.12 or later.
  • Loading branch information
rra committed Mar 18, 2024
1 parent df25d4e commit fb917fd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/tap/perl/Test/RRA.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ package Test::RRA v11.0.0;

use 5.012;
use autodie;
use base qw(Exporter);
use warnings;

use Carp qw(croak);
use Exporter qw(import);
use File::Temp;

# Abort if Test::More was loaded before Test::RRA to be sure that we get the
Expand Down
2 changes: 1 addition & 1 deletion tests/tap/perl/Test/RRA/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
package Test::RRA::Config v11.0.0;

use 5.012;
use base qw(Exporter);
use warnings;

use Exporter qw(import);
use Test::More;

# Exports.
Expand Down
2 changes: 1 addition & 1 deletion tests/tap/perl/Test/RRA/ModuleVersion.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ package Test::RRA::ModuleVersion v11.0.0;

use 5.012;
use autodie;
use base qw(Exporter);
use warnings;

use Exporter qw(import);
use File::Find qw(find);
use Test::More;
use Test::RRA::Config qw(@MODULE_VERSION_IGNORE);
Expand Down

0 comments on commit fb917fd

Please sign in to comment.