summaryrefslogtreecommitdiff
path: root/ext/File-Glob
diff options
context:
space:
mode:
authorAbigail <abigail@abigail.be>2016-11-14 19:08:12 +0100
committerAbigail <abigail@abigail.be>2017-01-16 19:18:11 +0100
commita0e213fcb5aa6690f639123c7aedb590e790907b (patch)
tree8726bcc75004041a1af95835c3fb7ec3a7422697 /ext/File-Glob
parentc4d8d6a210eeb43ce8a86793561fb5c56d47f482 (diff)
downloadperl-a0e213fcb5aa6690f639123c7aedb590e790907b.tar.gz
Actively deprecate File::Glob::glob().
This function has been deprecated since 5.8. However, no deprecation message was issued; only perl5.008delta.pod and a comment in the file mention its deprecation. This patch issues a deprecation message, and warns the user it will be gone in perl 5.30. Since all this method does is calling File::Glob::bsd_glob anyway, code calling this is easily fixed.
Diffstat (limited to 'ext/File-Glob')
-rw-r--r--ext/File-Glob/Glob.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/File-Glob/Glob.pm b/ext/File-Glob/Glob.pm
index c9c2d29f8e..c619749fa0 100644
--- a/ext/File-Glob/Glob.pm
+++ b/ext/File-Glob/Glob.pm
@@ -37,7 +37,7 @@ pop @{$EXPORT_TAGS{bsd_glob}}; # no "glob"
@EXPORT_OK = (@{$EXPORT_TAGS{'glob'}}, 'csh_glob');
-$VERSION = '1.27';
+$VERSION = '1.28';
sub import {
require Exporter;
@@ -75,6 +75,12 @@ if ($^O =~ /^(?:MSWin32|VMS|os2|dos|riscos)$/) {
# File::Glob::glob() is deprecated 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;
}