This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
prevent mro.pm from loading DynaLoader
authorGraham Knop <haarg@haarg.org>
Sat, 15 Apr 2017 14:23:11 +0000 (16:23 +0200)
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Fri, 2 Jun 2017 12:39:59 +0000 (13:39 +0100)
XSLoader::load cares about the package it is called from.  If it is a
different package from what you are trying to load, it falls back to
loading and using DynaLoader.

Move the load call to be in the mro package as it should be, so that it
doesn't trigger needless extra load.

ext/mro/mro.pm

index 92e8ca3..40aeb7a 100644 (file)
@@ -12,7 +12,10 @@ use warnings;
 
 # mro.pm versions < 1.00 reserved for MRO::Compat
 #  for partial back-compat to 5.[68].x
-our $VERSION = '1.20';
+our $VERSION = '1.21';
+
+require XSLoader;
+XSLoader::load('mro');
 
 sub import {
     mro::set_mro(scalar(caller), $_[1]) if $_[1];
@@ -37,9 +40,6 @@ sub method {
     return;
 }
 
-require XSLoader;
-XSLoader::load('mro');
-
 1;
 
 __END__