Skip Menu |
Report information
Id: 133586
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: jkeenan [at] pobox.com
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: unknown
Perl Version: (no value)
Fixed In: (no value)



To: perlbug [...] perl.org
Date: Sat, 13 Oct 2018 10:08:49 -0400
Subject: Remove File::Glob::glob()
From: James E Keenan <jkeenan [...] pobox.com>
pod/perldeprecate.pod contains this section on File::Glob::glob(): ##### "File::Glob::glob()" will disappear "File::Glob" has a function called "glob", which just calls "bsd_glob". However, its prototype is different from the prototype of "CORE::glob", and hence, "File::Glob::glob" should not be used. "File::Glob::glob()" was deprecated in Perl 5.8. A deprecation message was issued from Perl 5.26 onwards, and the function will disappear in Perl 5.30. Code using "File::Glob::glob()" should call "File::Glob::bsd_glob()" instead. ##### This deprecation has not yet been promoted into a fatalization. ##### $ ./bin/perl -Ilib -V | ack 'Commit id|Compiled at' Commit id: 8fc05532aec097a3733b92fbb2cabb1528daa5c4 Compiled at Oct 13 2018 10:02:56 $ ./bin/perl -MFile::Glob -e 'File::Glob::glob();' File::Glob::glob() will disappear in perl 5.30. Use File::Glob::bsd_glob() instead. at -e line 1. Usage: File::Glob::bsd_glob(pattern_sv, ...) at -e line 1. ##### Implement the fatalization. Adapt tests and documentation accordingly.
Download perl_V.txt
text/plain 3.2k

Message body is not shown because sender requested not to inline it.

RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.4k
On Sat, 13 Oct 2018 14:09:08 GMT, jkeenan@pobox.com wrote: Show quoted text
> pod/perldeprecate.pod contains this section on File::Glob::glob(): > > ##### > "File::Glob::glob()" will disappear > > "File::Glob" has a function called "glob", which just calls > "bsd_glob". However, its prototype is different from the > prototype of "CORE::glob", and hence, "File::Glob::glob" > should not be used. > > "File::Glob::glob()" was deprecated in Perl 5.8. A > deprecation message was issued from Perl 5.26 onwards, and > the function will disappear in Perl 5.30. > > Code using "File::Glob::glob()" should call > "File::Glob::bsd_glob()" instead. > ##### > > This deprecation has not yet been promoted into a fatalization. > > ##### > $ ./bin/perl -Ilib -V | ack 'Commit id|Compiled at' > Commit id: 8fc05532aec097a3733b92fbb2cabb1528daa5c4 > Compiled at Oct 13 2018 10:02:56 > $ ./bin/perl -MFile::Glob -e 'File::Glob::glob();' > File::Glob::glob() will disappear in perl 5.30. Use > File::Glob::bsd_glob() instead. at -e line 1. > Usage: File::Glob::bsd_glob(pattern_sv, ...) at -e line 1. > ##### > > Implement the fatalization. Adapt tests and documentation accordingly.
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. -- James E Keenan (jkeenan@cpan.org)
Subject: 113586-0001-Remove-File-Glob-glob-in-perl-5.30.patch
From 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
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 136b
Following review by Tony Cook, merged to blead in commit df8b709bfcaea9932dd434f18393bfcb4e3d5568. -- James E Keenan (jkeenan@cpan.org)
Download (untitled) / with headers
text/plain 313b
Thank 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 resolved. Perl 5.30.0 may be downloaded via: https://metacpan.org/release/XSAWYERX/perl-5.30.0 If you find that the problem persists, feel free to reopen this ticket.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org