This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove unnecessary module loads from B and O
[perl5.git] / ext / B / O.pm
index 94ee754..7393441 100644 (file)
@@ -2,8 +2,7 @@ package O;
 
 our $VERSION = '1.02';
 
-use B qw(minus_c save_BEGINs);
-use Carp;
+use B ();
 
 sub import {
     my ($class, @options) = @_;
@@ -21,8 +20,8 @@ sub import {
     my $backend = shift (@options);
     eval q[
        BEGIN {
-           minus_c;
-           save_BEGINs;
+           B::minus_c;
+           B::save_BEGINs;
        }
 
        CHECK {
@@ -51,7 +50,9 @@ sub import {
        }
     ];
     if ($@) {
-        croak "Loading compiler backend 'B::$backend' failed: $@";
+        my $msg = "$@";
+        require Carp;
+        Carp::croak("Loading compiler backend 'B::$backend' failed: $msg");
     }
 }