Skip to content

Commit df8b709

Browse files
committed
Remove File::Glob::glob() in perl-5.30
For: RT # 133586
1 parent d8ff3e9 commit df8b709

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

ext/File-Glob/Glob.pm

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require XSLoader;
1313
%EXPORT_TAGS = (
1414
'glob' => [ qw(
1515
GLOB_ABEND
16-
GLOB_ALPHASORT
16+
GLOB_ALPHASORT
1717
GLOB_ALTDIRFUNC
1818
GLOB_BRACE
1919
GLOB_CSH
@@ -29,15 +29,13 @@ require XSLoader;
2929
GLOB_QUOTE
3030
GLOB_TILDE
3131
bsd_glob
32-
glob
3332
) ],
3433
);
3534
$EXPORT_TAGS{bsd_glob} = [@{$EXPORT_TAGS{glob}}];
36-
pop @{$EXPORT_TAGS{bsd_glob}}; # no "glob"
3735

3836
@EXPORT_OK = (@{$EXPORT_TAGS{'glob'}}, 'csh_glob');
3937

40-
$VERSION = '1.31';
38+
$VERSION = '1.32';
4139

4240
sub import {
4341
require Exporter;
@@ -72,17 +70,11 @@ if ($^O =~ /^(?:MSWin32|VMS|os2|dos|riscos)$/) {
7270
$DEFAULT_FLAGS |= GLOB_NOCASE();
7371
}
7472

75-
# File::Glob::glob() is deprecated because its prototype is different from
76-
# CORE::glob() (use bsd_glob() instead)
73+
# File::Glob::glob() removed in perl-5.30 because its prototype is different
74+
# from CORE::glob() (use bsd_glob() instead)
7775
sub glob {
78-
use 5.024;
79-
use warnings ();
80-
warnings::warnif (deprecated =>
81-
"File::Glob::glob() will disappear in perl 5.30. " .
82-
"Use File::Glob::bsd_glob() instead.") unless state $warned ++;
83-
84-
splice @_, 1; # no flags
85-
goto &bsd_glob;
76+
die "File::Glob::glob() was removed in perl 5.30. " .
77+
"Use File::Glob::bsd_glob() instead. $!";
8678
}
8779

8880
1;

ext/File-Glob/t/basic.t

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,20 @@ if (opendir(D, ".")) {
4444
@correct = grep { !/^\./ } sort readdir(D);
4545
closedir D;
4646
}
47-
my @a = do {no warnings 'deprecated'; File::Glob::glob("*", 0);};
48-
@a = sort @a;
49-
if (GLOB_ERROR) {
50-
fail(GLOB_ERROR);
51-
} else {
52-
is_deeply(\@a, \@correct);
47+
{
48+
local $@;
49+
my $expect =
50+
qr/File::Glob::glob\(\) was removed in perl 5\.30\. Use File::Glob::bsd_glob\(\) instead/;
51+
eval { File::Glob::glob("*", 0); };
52+
like $@, $expect,
53+
"Got expected error message for removal of File::Glob::glob()";
5354
}
5455
chdir '..' or die "chdir .. $!";
5556

5657
# look up the user's home directory
5758
# should return a list with one item, and not set ERROR
59+
my @a;
60+
5861
SKIP: {
5962
my ($name, $home);
6063
skip $^O, 1 if $^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'VMS'

0 commit comments

Comments
 (0)