summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorBenjamin Sugars <bsugars@canoe.ca>2001-04-03 13:03:48 -0400
committerJarkko Hietaniemi <jhi@iki.fi>2001-04-04 04:20:24 +0000
commit7d3fb23018f73b213481a8b6b108e1dc03cefcff (patch)
tree58559eb0c4adc2eada2d027b6c5fa664215f37fa /op.c
parent4c901d042e1d6bd9046b03cfbf665c2899614c5c (diff)
downloadperl-7d3fb23018f73b213481a8b6b108e1dc03cefcff.tar.gz
Re: [PATCH] Lighten up glob
Message-ID: <Pine.LNX.4.21.0104031700340.2143-100000@marmot.rim.canoe.ca> p4raw-id: //depot/perl@9541
Diffstat (limited to 'op.c')
-rw-r--r--op.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/op.c b/op.c
index f6ec916202..59cbfa39fc 100644
--- a/op.c
+++ b/op.c
@@ -3306,6 +3306,20 @@ Perl_utilize(pTHX_ int aver, I32 floor, OP *version, OP *id, OP *arg)
PL_expect = XSTATE;
}
+/*
+=for apidoc load_module
+
+Loads the module whose name is pointed to by the string part of name.
+Note that the actual module name, not its filename, should be given.
+Eg, "Foo::Bar" instead of "Foo/Bar.pm". flags can be any of
+PERL_LOADMOD_DENY, PERL_LOADMOD_NOIMPORT, or PERL_LOADMOD_IMPORT_OPS
+(or 0 for no flags). ver, if specified, provides version semantics
+similar to C<use Foo::Bar VERSION>. The optional trailing SV*
+arguments can be used to specify arguments to the module's import()
+method, similar to C<use Foo::Bar VERSION LIST>.
+
+=cut */
+
void
Perl_load_module(pTHX_ U32 flags, SV *name, SV *ver, ...)
{
@@ -5848,11 +5862,14 @@ Perl_ck_glob(pTHX_ OP *o)
#if !defined(PERL_EXTERNAL_GLOB)
/* XXX this can be tightened up and made more failsafe. */
if (!gv) {
+ GV *glob_gv;
ENTER;
- Perl_load_module(aTHX_ 0, newSVpvn("File::Glob", 10), Nullsv,
- /* null-terminated import list */
- newSVpvn(":globally", 9), Nullsv);
+ Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, newSVpvn("File::Glob", 10), Nullsv,
+ Nullsv, Nullsv);
gv = gv_fetchpv("CORE::GLOBAL::glob", FALSE, SVt_PVCV);
+ glob_gv = gv_fetchpv("File::Glob::csh_glob", FALSE, SVt_PVCV);
+ GvCV(gv) = GvCV(glob_gv);
+ GvIMPORTED_CV_on(gv);
LEAVE;
}
#endif /* PERL_EXTERNAL_GLOB */