LEAVE;
FREETMPS;
+
/* We must account for everything. */
/* Destroy the main CV and syntax tree */
PL_main_cv = Nullcv;
PL_dirty = TRUE;
+ /* Tell PerlIO we are about to tear things apart in case
+ we have layers which are using resources that should
+ be cleaned up now.
+ */
+
+ PerlIO_destruct(aTHX);
+
if (PL_sv_objcount) {
/*
* Try to destruct global references. We do this first so that the
#ifdef USE_LOCALE_NUMERIC
Safefree(PL_numeric_name);
PL_numeric_name = Nullch;
- SvREFCNT_dec(PL_numeric_radix);
+ SvREFCNT_dec(PL_numeric_radix_sv);
#endif
/* clear utf8 character classes */
/*
=for apidoc p||require_pv
-Tells Perl to C<require> a module.
+Tells Perl to C<require> the file named by the string argument. It is
+analogous to the Perl code C<eval "require '$file'">. It's even
+implemented that way; consider using Perl_load_module instead.
-=cut
-*/
+=cut */
void
Perl_require_pv(pTHX_ const char *pv)
}
#endif
#endif
+#ifdef IAMSUID
+ errno = EPERM;
+ Perl_croak(aTHX_ "Can't open perl script: %s\n",
+ Strerror(errno));
+#else
Perl_croak(aTHX_ "Can't open perl script \"%s\": %s\n",
CopFILE(PL_curcop), Strerror(errno));
+#endif
}
}
PL_stdingv = gv_fetchpv("STDIN",TRUE, SVt_PVIO);
GvMULTI_on(PL_stdingv);
io = GvIOp(PL_stdingv);
+ IoTYPE(io) = IoTYPE_RDONLY;
IoIFP(io) = PerlIO_stdin();
tmpgv = gv_fetchpv("stdin",TRUE, SVt_PV);
GvMULTI_on(tmpgv);
tmpgv = gv_fetchpv("STDOUT",TRUE, SVt_PVIO);
GvMULTI_on(tmpgv);
io = GvIOp(tmpgv);
+ IoTYPE(io) = IoTYPE_WRONLY;
IoOFP(io) = IoIFP(io) = PerlIO_stdout();
setdefout(tmpgv);
tmpgv = gv_fetchpv("stdout",TRUE, SVt_PV);
PL_stderrgv = gv_fetchpv("STDERR",TRUE, SVt_PVIO);
GvMULTI_on(PL_stderrgv);
io = GvIOp(PL_stderrgv);
+ IoTYPE(io) = IoTYPE_WRONLY;
IoOFP(io) = IoIFP(io) = PerlIO_stderr();
tmpgv = gv_fetchpv("stderr",TRUE, SVt_PV);
GvMULTI_on(tmpgv);