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, ...)
{
list(kid);
break;
case OA_AVREF:
+ if ((type == OP_PUSH || type == OP_UNSHIFT)
+ && !kid->op_sibling && ckWARN(WARN_SYNTAX))
+ Perl_warner(aTHX_ WARN_SYNTAX,
+ "Useless use of %s with no values",
+ PL_op_desc[type]);
+
if (kid->op_type == OP_CONST &&
(kid->op_private & OPpCONST_BARE))
{
#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 */