--- pp_ctl.c.old Mon Jul 30 15:15:07 2001
+++ pp_ctl.c Mon Jul 30 17:48:25 2001
@@ -3043,6 +3043,7 @@
GV *filter_child_proc = 0;
SV *filter_state = 0;
SV *filter_sub = 0;
+ OP *eval_result; /* japhy (07/30/01) for no package test at bottom */
sv = POPs;
if (SvNIOKp(sv)) {
@@ -3104,6 +3105,7 @@
}
}
name = SvPV(sv, len);
+
if (!(name && len > 0 && *name))
DIE(aTHX_ "Null filename used");
TAINT_PROPER("require");
@@ -3374,7 +3376,48 @@
PL_eval_owner = thr;
MUTEX_UNLOCK(&PL_eval_mutex);
#endif /* USE_THREADS */
- return DOCATCH(doeval(gimme, NULL));
+
+ /*
+ japhy (07/30/2001)
+ test to see if a stash of the name of the file has been created
+ if the require()d file was a module -- 'use Strict' works on Windows
+ */
+
+ eval_result = doeval(gimme, NULL);
+
+#ifdef WIN32
+ if (strcmp(name + len - 3, ".pm")) {
+ char *pkg;
+ int slash_count = 0, i = 0;
+
+ for (i = 0; i < len - 3; i++) {
+ if (name[i] == '/') slash_count++;
+ }
+
+ /* "Foo/Bar.pm" + 1 (slash) - 3 (".pm") + 1 ("\0") */
+ pkg = malloc(sizeof(char) * (len + slash_count - 3 + 1));
+
+ slash_count = 0;
+
+ for (i = 0; i < len - 3; i++) {
+ if (name[i] == '/') {
+ pkg[i + slash_count] = ':';
+ pkg[i + ++slash_count] = ':';
+ }
+ else pkg[i + slash_count] = name[i];
+ }
+ pkg[i + slash_count] = '\0';
+
+ if (!gv_stashpv(pkg, FALSE))
+ Perl_warner(
+ aTHX_ WARN_MISC,
+ "Package `%s' not found (did you use the incorrect case?)",
+ pkg
+ );
+ }
+#endif
+
+ return DOCATCH(eval_result);
}
PP(pp_dofile)
Thread Next