6 @INC = qw(: ::lib ::macos:lib);
11 require Config; import Config;
12 if ($Config{'extensions'} !~ /\bFile\/Glob\b/i) {
19 print "not ok 1\n" unless $loaded;
23 *CORE::GLOBAL::glob = sub { "Just another Perl hacker," };
27 if ("Just another Perl hacker," ne (<*>)[0]) {
29 Your version of perl ($]) doesn't seem to allow extensions to override
30 the core glob operator.
35 use File::Glob ':globally';
39 $_ = $^O eq "MacOS" ? ":op:*.t" : "op/*.t";
41 print "not " if $_ ne ($^O eq "MacOS" ? ":op:*.t" : "op/*.t");
44 print "# |@r|\nnot " if @r < 3;
47 # check if <*/*> works
53 # at least t/global.t t/basic.t, t/taint.t
54 print "not " if @r < 3;
58 # check if scalar context works
61 while (defined($_ = <:*:*.t>)) {
66 while (defined($_ = <*/*.t>)) {
71 print "not " if @r != $r;
74 # check if list context works
87 print "not " if @r != $r;
90 # test if implicit assign to $_ in while() works
103 print "not " if @r != $r;
106 # test if explicit glob() gets assign magic too
108 while (glob($^O eq 'MacOS' ? ':*:*.t' : '*/*.t')) {
112 print "not " if "@r" ne "@s";
115 # how about in a different package, like?
117 use File::Glob ':globally';
119 while (glob($^O eq 'MacOS' ? ':*:*.t' : '*/*.t')) {
123 print "not " if "@r" ne "@s";
126 # test if different glob ops maintain independent contexts
129 if ($^O eq "MacOS") {
133 while (<:bas*:*.t>) {
150 print "not " if "@r" ne "@s" or not $i;