This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add :bsd_glob export tag to File::Glob [perl #96116]
[perl5.git] / ext / File-Glob / Glob.pm
index a665816..974625b 100644 (file)
@@ -29,10 +29,12 @@ use feature 'switch';
         GLOB_NOSPACE
         GLOB_QUOTE
         GLOB_TILDE
-        glob
         bsd_glob
+        glob
     ) ],
 );
+$EXPORT_TAGS{bsd_glob} = [@{$EXPORT_TAGS{glob}}];
+pop @{$EXPORT_TAGS{bsd_glob}}; # no "glob"
 
 @EXPORT_OK   = (@{$EXPORT_TAGS{'glob'}}, 'csh_glob');
 
@@ -50,6 +52,9 @@ sub import {
                no warnings 'redefine';
                *CORE::GLOBAL::glob = \&File::Glob::csh_glob;
            }
+           if ($_ eq ':bsd_glob') {
+               no strict; *{caller."::glob"} = \&bsd_glob_override;
+           }
            $passthrough = 1;
        }
        $passthrough;