SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;
}
+/*
+=for apidoc mg_magical
+
+Turns on the magical status of an SV. See C<sv_magic>.
+
+=cut
+*/
+
void
Perl_mg_magical(pTHX_ SV *sv)
{
}
}
+/*
+=for apidoc mg_get
+
+Do magic after a value is retrieved from the SV. See C<sv_magic>.
+
+=cut
+*/
+
int
Perl_mg_get(pTHX_ SV *sv)
{
return 0;
}
+/*
+=for apidoc mg_set
+
+Do magic after a value is assigned to the SV. See C<sv_magic>.
+
+=cut
+*/
+
int
Perl_mg_set(pTHX_ SV *sv)
{
return 0;
}
+/*
+=for apidoc mg_length
+
+Report on the SV's length. See C<sv_magic>.
+
+=cut
+*/
+
U32
Perl_mg_length(pTHX_ SV *sv)
{
return 0;
}
+/*
+=for apidoc mg_clear
+
+Clear something magical that the SV represents. See C<sv_magic>.
+
+=cut
+*/
+
int
Perl_mg_clear(pTHX_ SV *sv)
{
return 0;
}
+/*
+=for apidoc mg_find
+
+Finds the magic pointer for type matching the SV. See C<sv_magic>.
+
+=cut
+*/
+
MAGIC*
Perl_mg_find(pTHX_ SV *sv, int type)
{
return 0;
}
+/*
+=for apidoc mg_copy
+
+Copies the magic from one SV to another. See C<sv_magic>.
+
+=cut
+*/
+
int
Perl_mg_copy(pTHX_ SV *sv, SV *nsv, const char *key, I32 klen)
{
return count;
}
+/*
+=for apidoc mg_free
+
+Free any magic storage used by the SV. See C<sv_magic>.
+
+=cut
+*/
+
int
Perl_mg_free(pTHX_ SV *sv)
{
case '\004': /* ^D */
sv_setiv(sv, (IV)(PL_debug & 32767));
+#if defined(YYDEBUG) && defined(DEBUGGING)
+ PL_yydebug = (PL_debug & 1);
+#endif
break;
case '\005': /* ^E */
#ifdef MACOS_TRADITIONAL
sv_setiv(sv, (IV)PL_basetime);
#endif
break;
+ case '\025': /* ^U */
+ sv_setiv(sv, (IV)PL_bigchar);
+ break;
case '\027': /* ^W & $^Warnings*/
if (*(mg->mg_ptr+1) == '\0')
sv_setiv(sv, (IV)((PL_dowarn & G_WARN_ON) ? TRUE : FALSE));
PL_tainted = FALSE;
}
sv_setpvn(sv, s, i);
+ if ((PL_curpm->op_pmdynflags & PMdf_UTF8) && !IN_BYTE)
+ SvUTF8_on(sv);
+ else
+ SvUTF8_off(sv);
if (PL_tainting)
PL_tainted = (was_tainted || RX_MATCH_TAINTED(rx));
break;
break;
case '(':
sv_setiv(sv, (IV)PL_gid);
+#ifdef HAS_GETGROUPS
Perl_sv_setpvf(aTHX_ sv, "%"Gid_t_f, PL_gid);
+#endif
goto add_groups;
case ')':
sv_setiv(sv, (IV)PL_egid);
+#ifdef HAS_GETGROUPS
Perl_sv_setpvf(aTHX_ sv, "%"Gid_t_f, PL_egid);
+#endif
add_groups:
#ifdef HAS_GETGROUPS
{
#if defined(VMS)
Perl_die(aTHX_ "Can't make list assignment to %%ENV on this system");
#else
-# ifdef WIN32
+# ifdef PERL_IMPLICIT_SYS
+ PerlEnv_clearenv();
+# else
+# ifdef WIN32
char *envv = GetEnvironmentStrings();
char *cur = envv;
STRLEN len;
cur += len+1;
}
FreeEnvironmentStrings(envv);
-# else
-# ifdef CYGWIN
+# else
+# ifdef CYGWIN
I32 i;
for (i = 0; environ[i]; i++)
- Safefree(environ[i]);
-# else
-# ifndef PERL_USE_SAFE_PUTENV
+ safesysfree(environ[i]);
+# else
+# ifndef PERL_USE_SAFE_PUTENV
I32 i;
if (environ == PL_origenviron)
else
for (i = 0; environ[i]; i++)
safesysfree(environ[i]);
-# endif /* PERL_USE_SAFE_PUTENV */
-# endif /* CYGWIN */
+# endif /* PERL_USE_SAFE_PUTENV */
+# endif /* CYGWIN */
environ[0] = Nullch;
-# endif /* WIN32 */
+# endif /* WIN32 */
+# endif /* PERL_IMPLICIT_SYS */
#endif /* VMS */
return 0;
}
i = SvTRUE(sv);
svp = av_fetch(GvAV(gv),
atoi(MgPV(mg,n_a)), FALSE);
- if (svp && SvIOKp(*svp) && (o = (OP*)SvSTASH(*svp)))
+ if (svp && SvIOKp(*svp) && (o = INT2PTR(OP*,SvIVX(*svp))))
o->op_private = i;
else if (ckWARN_d(WARN_INTERNAL))
Perl_warner(aTHX_ WARN_INTERNAL, "Can't break at that line\n");
if (mg && mg->mg_len >= 0) {
dTHR;
I32 i = mg->mg_len;
- if (IN_UTF8)
+ if (DO_UTF8(lsv))
sv_pos_b2u(lsv, &i);
sv_setiv(sv, i + PL_curcop->cop_arybase);
return 0;
SV* lsv = LvTARG(sv);
SSize_t pos;
STRLEN len;
- STRLEN ulen;
+ STRLEN ulen = 0;
dTHR;
mg = 0;
pos = SvIV(sv) - PL_curcop->cop_arybase;
- if (IN_UTF8) {
+ if (DO_UTF8(lsv)) {
ulen = sv_len_utf8(lsv);
if (ulen)
len = ulen;
- else
- ulen = 0;
}
if (pos < 0) {
PL_basetime = (Time_t)(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
#endif
break;
+ case '\025': /* ^U */
+ PL_bigchar = SvTRUE(sv);
+ break;
case '\027': /* ^W & $^Warnings */
if (*(mg->mg_ptr+1) == '\0') {
if ( ! (PL_dowarn & G_WARN_ALL_MASK)) {
case '.':
if (PL_localizing) {
if (PL_localizing == 1)
- save_sptr((SV**)&PL_last_in_gv);
+ SAVESPTR(PL_last_in_gv);
}
else if (SvOK(sv) && GvIO(PL_last_in_gv))
IoLINES(GvIOp(PL_last_in_gv)) = (long)SvIV(sv);