Skip to content

remove indirect calls to import() method #23106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configpm
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ if ($orig_config_txt ne $config_txt or $orig_heavy_txt ne $heavy_txt) {
unshift(@INC,'lib');
require $Config_PM;
require $Config_heavy;
import Config;
Config->import;

die "$0: $Config_PM not valid"
unless $Config{'PERL_CONFIG_SH'} eq 'true';
Expand Down
2 changes: 1 addition & 1 deletion dist/Devel-PPPort/parts/inc/podtest
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ else {
use Test::Pod;
$Test::Pod::VERSION >= 1.41
or die "Test::Pod version only $Test::Pod::VERSION";
import Test::Pod tests => scalar @pods;
Test::Pod->import(tests => scalar @pods);
};
$reason = 'Test::Pod >= 1.41 required' if $@;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/Exporter/t/Exporter.t
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ sub TIESCALAR{bless[]}
{
tie my $t, __PACKAGE__;
for($t) { # $_ is now tied
import Exporter::for::Tied::_;
Exporter::for::Tied::_->import;
}
}
::ok(1, 'import with tied $_');
Expand Down
2 changes: 1 addition & 1 deletion dist/ExtUtils-CBuilder/t/00-have-compiler.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ BEGIN {
if ($^O eq 'VMS') {
# So we can get the return value of system()
require vmsish;
import vmsish;
vmsish->import;
}
}

Expand Down
2 changes: 1 addition & 1 deletion dist/ExtUtils-CBuilder/t/01-basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ BEGIN {
if ($^O eq 'VMS') {
# So we can get the return value of system()
require vmsish;
import vmsish;
vmsish->import;
}
}
use ExtUtils::CBuilder;
Expand Down
2 changes: 1 addition & 1 deletion dist/ExtUtils-CBuilder/t/02-link.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ BEGIN {
if ($^O eq 'VMS') {
# So we can get the return value of system()
require vmsish;
import vmsish;
vmsish->import;
}
}
use ExtUtils::CBuilder;
Expand Down
2 changes: 1 addition & 1 deletion dist/ExtUtils-CBuilder/t/03-cplusplus.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ BEGIN {
if ($^O eq 'VMS') {
# So we can get the return value of system()
require vmsish;
import vmsish;
vmsish->import;
}
}
use ExtUtils::CBuilder;
Expand Down
2 changes: 1 addition & 1 deletion dist/I18N-Collate/t/I18N-Collate.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use strict;
no warnings;

BEGIN {
require Config; import Config;
require Config; Config->import;
if (!$::Config{d_setlocale} || $::Config{ccflags} =~ /\bD?NO_LOCALE\b/) {
print "1..0\n";
exit;
Expand Down
2 changes: 1 addition & 1 deletion dist/Safe/t/safe1.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!./perl -w
$|=1;
BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion dist/Safe/t/safe2.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!./perl -w
$|=1;
BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion dist/Safe/t/safe3.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!perl -w

BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bOpcode\b/
&& $Config{'extensions'} !~ /\bPOSIX\b/
&& $Config{'osname'} ne 'VMS')
Expand Down
2 changes: 1 addition & 1 deletion dist/Safe/t/safeload.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

BEGIN {
require Config;
import Config;
Config->import;
if ($Config{'extensions'} !~ /\bOpcode\b/) {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion dist/Safe/t/safenamedcap.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ BEGIN {
exit 0;
}
require Config;
import Config;
Config->import;
if ($Config{'extensions'} !~ /\bOpcode\b/) {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion dist/Safe/t/saferegexp.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!perl -w

BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bOpcode\b/) {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion dist/Safe/t/safesecurity.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

BEGIN {
require Config;
import Config;
Config->import;
if ($Config{'extensions'} !~ /\bOpcode\b/) {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion dist/Safe/t/safesig.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

BEGIN {
require Config;
import Config;
Config->import;
if ($Config{'extensions'} !~ /\bOpcode\b/) {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion dist/Safe/t/safesort.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!perl -w
$|=1;
BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion dist/Safe/t/safeuniversal.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

BEGIN {
require Config;
import Config;
Config->import;
if ($Config{'extensions'} !~ /\bOpcode\b/) {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion dist/Safe/t/safeutf8.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!perl -w
$|=1;
BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion dist/Safe/t/safewrap.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

$|=1;
BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion dist/autouse/t/autouse.t
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ SKIP: {
is $w, undef,
'no redefinition warning when clobbering autouse stub with new sub';
undef $w;
import MyTestModule2 'test_function2';
MyTestModule2->import('test_function2');
is $w, undef,
'no redefinition warning when clobbering autouse stub via *a=\&b';
}
Expand Down
6 changes: 3 additions & 3 deletions dist/threads/lib/threads.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use 5.008;
use strict;
use warnings;

our $VERSION = '2.42'; # remember to update version in POD!
our $VERSION = '2.43'; # remember to update version in POD!
my $XS_VERSION = $VERSION;
#$VERSION = eval $VERSION;

Expand Down Expand Up @@ -56,7 +56,7 @@ sub import
}

} elsif ($sym =~ /^str/i) {
import overload ('""' => \&tid);
overload->import('""' => \&tid);

} elsif ($sym =~ /^(?::all|yield)$/) {
push(@EXPORT, qw(yield));
Expand Down Expand Up @@ -134,7 +134,7 @@ threads - Perl interpreter-based threads

=head1 VERSION

This document describes threads version 2.42
This document describes threads version 2.43

=head1 WARNING

Expand Down
2 changes: 1 addition & 1 deletion ext/Devel-Peek/t/Peek.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!./perl -T

BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bDevel\/Peek\b/) {
print "1..0 # Skip: Devel::Peek was not built\n";
exit 0;
Expand Down
4 changes: 2 additions & 2 deletions ext/Fcntl/t/syslfs.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# If you modify/add tests here, remember to update also t/op/lfs.t.

BEGIN {
require Config; import Config;
require Config; Config->import;
# Don't bother if there are no quad offsets.
if ($Config{lseeksize} < 8) {
print "1..0 # Skip: no 64-bit file offsets\n";
exit(0);
}
require Fcntl; import Fcntl qw(/^O_/ /^SEEK_/);
require Fcntl; Fcntl->import(qw(/^O_/ /^SEEK_/));
}

use strict;
Expand Down
2 changes: 1 addition & 1 deletion ext/File-DosGlob/t/DosGlob.t
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ if ($cwd =~ /^([a-zA-Z]:)/) {
SKIP: {
require Config;
skip "no XS::APItest"
unless eval { require XS::APItest; import XS::APItest "sv_count"; 1 };
unless eval { require XS::APItest; XS::APItest->import("sv_count"); 1 };
# Use a random number of ops, so that the glob op does not reuse the
# same address each time, giving us false passes.
my($count,$count2);
Expand Down
2 changes: 1 addition & 1 deletion ext/File-Glob/t/basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bFile\/Glob\b/i) {
print "1..0\n";
exit 0;
Expand Down
6 changes: 3 additions & 3 deletions ext/File-Glob/t/case.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bFile\/Glob\b/i) {
print "1..0\n";
exit 0;
Expand All @@ -18,12 +18,12 @@ BEGIN {

my $pat = "op/G*.t";

import File::Glob ':nocase';
File::Glob->import(':nocase');
@a = csh_glob($pat);
cmp_ok(scalar @a, '>=', 8, 'use of the case sensitivity tags, via csh_glob()');

# This may fail on systems which are not case-PRESERVING
import File::Glob ':case';
File::Glob->import(':case');
@a = csh_glob($pat);
is(scalar @a, 0, 'None should be uppercase');

Expand Down
2 changes: 1 addition & 1 deletion ext/File-Glob/t/global.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bFile\/Glob\b/i) {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion ext/File-Glob/t/taint.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bFile\/Glob\b/i) {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion ext/File-Glob/t/threads.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bFile\/Glob\b/i) {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion ext/Hash-Util/t/Util.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

BEGIN {
if ($ENV{PERL_CORE}) {
require Config; import Config;
require Config; Config->import;
no warnings 'once';
if ($Config{extensions} !~ /\bHash\/Util\b/) {
print "1..0 # Skip: Hash::Util was not built\n";
Expand Down
2 changes: 1 addition & 1 deletion ext/IPC-Open3/t/IPC-Open3.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!./perl -w

BEGIN {
require Config; import Config;
require Config; Config->import;
if (!$Config{'d_fork'}
# open2/3 supported on win32
&& $^O ne 'MSWin32')
Expand Down
2 changes: 1 addition & 1 deletion ext/Opcode/t/Opcode.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$|=1;

BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion ext/Opcode/t/ops.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!./perl

BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion ext/POSIX/t/mb.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# with the correct LC_CTYPE set in the environment.

BEGIN {
require Config; import Config;
require Config; Config->import;
if ($^O ne 'VMS' and $Config{'extensions'} !~ /\bPOSIX\b/) {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion ext/POSIX/t/posix.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!./perl

BEGIN {
require Config; import Config;
require Config; Config->import;
if ($^O ne 'VMS' and $Config{'extensions'} !~ /\bPOSIX\b/) {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion ext/POSIX/t/taint.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!./perl -Tw

BEGIN {
require Config; import Config;
require Config; Config->import;
if ($^O ne 'VMS' and $Config{'extensions'} !~ /\bPOSIX\b/) {
print "1..0\n";
exit 0;
Expand Down
2 changes: 1 addition & 1 deletion ext/PerlIO-encoding/t/fallback.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ BEGIN {
print "1..0 # Skip: No Encode\n";
exit 0;
}
import Encode qw(:fallback_all);
Encode->import(qw(:fallback_all));
}

use Test::More tests => 10;
Expand Down
2 changes: 1 addition & 1 deletion ext/Sys-Hostname/t/Hostname.t
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!./perl

BEGIN {
require Config; import Config;
require Config; Config->import;
if ($Config{'extensions'} !~ /\bSys\/Hostname\b/) {
print "1..0 # Skip: Sys::Hostname was not built\n";
exit 0;
Expand Down
Loading
Loading