-
Notifications
You must be signed in to change notification settings - Fork 555
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
Remove File::Glob::glob() in perl-5.30 #16721
Comments
From @jkeenanpod/perldeprecate.pod contains this section on File::Glob::glob(): ##### "File::Glob" has a function called "glob", which just calls "File::Glob::glob()" was deprecated in Perl 5.8. A Code using "File::Glob::glob()" should call This deprecation has not yet been promoted into a fatalization. ##### Implement the fatalization. Adapt tests and documentation accordingly. |
From @jkeenanSummary of my perl5 (revision 5 version 29 subversion 4) configuration: Characteristics of this binary (from libperl): |
From @jkeenanOn Sat, 13 Oct 2018 14:09:08 GMT, jkeenan@pobox.com wrote:
Please review the implementation in this branch: smoke-me/jkeenan/133586-file-glob-glob Or in the patch attached. It would be good to get this reviewed and merged to blead in time for the monthly development release scheduled for next Saturday, Oct 20. Thank you very much. |
From @jkeenan113586-0001-Remove-File-Glob-glob-in-perl-5.30.patchFrom b2a70ee1c150f5347eaa39d7243e77e7cff726ed Mon Sep 17 00:00:00 2001
From: James E Keenan <jkeenan@cpan.org>
Date: Sat, 13 Oct 2018 15:48:39 -0400
Subject: [PATCH] Remove File::Glob::glob() in perl-5.30
For: RT # 133586
---
ext/File-Glob/Glob.pm | 20 ++++++--------------
ext/File-Glob/t/basic.t | 15 +++++++++------
2 files changed, 15 insertions(+), 20 deletions(-)
diff --git a/ext/File-Glob/Glob.pm b/ext/File-Glob/Glob.pm
index 07df4941a1..368a755f50 100644
--- a/ext/File-Glob/Glob.pm
+++ b/ext/File-Glob/Glob.pm
@@ -13,7 +13,7 @@ require XSLoader;
%EXPORT_TAGS = (
'glob' => [ qw(
GLOB_ABEND
- GLOB_ALPHASORT
+ GLOB_ALPHASORT
GLOB_ALTDIRFUNC
GLOB_BRACE
GLOB_CSH
@@ -29,15 +29,13 @@ require XSLoader;
GLOB_QUOTE
GLOB_TILDE
bsd_glob
- glob
) ],
);
$EXPORT_TAGS{bsd_glob} = [@{$EXPORT_TAGS{glob}}];
-pop @{$EXPORT_TAGS{bsd_glob}}; # no "glob"
@EXPORT_OK = (@{$EXPORT_TAGS{'glob'}}, 'csh_glob');
-$VERSION = '1.31';
+$VERSION = '1.32';
sub import {
require Exporter;
@@ -72,17 +70,11 @@ if ($^O =~ /^(?:MSWin32|VMS|os2|dos|riscos)$/) {
$DEFAULT_FLAGS |= GLOB_NOCASE();
}
-# File::Glob::glob() is deprecated because its prototype is different from
-# CORE::glob() (use bsd_glob() instead)
+# File::Glob::glob() removed in perl-5.30 because its prototype is different
+# from CORE::glob() (use bsd_glob() instead)
sub glob {
- use 5.024;
- use warnings ();
- warnings::warnif (deprecated =>
- "File::Glob::glob() will disappear in perl 5.30. " .
- "Use File::Glob::bsd_glob() instead.") unless state $warned ++;
-
- splice @_, 1; # no flags
- goto &bsd_glob;
+ die "File::Glob::glob() was removed in perl 5.30. " .
+ "Use File::Glob::bsd_glob() instead. $!";
}
1;
diff --git a/ext/File-Glob/t/basic.t b/ext/File-Glob/t/basic.t
index f0363cdcdb..6ac911c6d5 100644
--- a/ext/File-Glob/t/basic.t
+++ b/ext/File-Glob/t/basic.t
@@ -44,17 +44,20 @@ if (opendir(D, ".")) {
@correct = grep { !/^\./ } sort readdir(D);
closedir D;
}
-my @a = do {no warnings 'deprecated'; File::Glob::glob("*", 0);};
-@a = sort @a;
-if (GLOB_ERROR) {
- fail(GLOB_ERROR);
-} else {
- is_deeply(\@a, \@correct);
+{
+ local $@;
+ my $expect =
+ qr/File::Glob::glob\(\) was removed in perl 5\.30\. Use File::Glob::bsd_glob\(\) instead/;
+ eval { File::Glob::glob("*", 0); };
+ like $@, $expect,
+ "Got expected error message for removal of File::Glob::glob()";
}
chdir '..' or die "chdir .. $!";
# look up the user's home directory
# should return a list with one item, and not set ERROR
+my @a;
+
SKIP: {
my ($name, $home);
skip $^O, 1 if $^O eq 'MSWin32' || $^O eq 'NetWare' || $^O eq 'VMS'
--
2.17.1
|
The RT System itself - Status changed from 'new' to 'open' |
@jkeenan - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.30.0, this and 160 other issues have been Perl 5.30.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#133586 (status was 'resolved')
Searchable as RT133586$
The text was updated successfully, but these errors were encountered: