Mailing List Archive

Bug in perl.c or did I miss a patch? (Resend)
In perl.c
-----------------------------------------------------------
static void
init_postdump_symbols(argc, argv, env)
register int argc;
register char **argv;
register char **env;
{
...
#ifndef VMS /* VMS doesn't have environ array */
if (env != environ) {
environ[0] = Nullch;
hv_magic(hv, envgv, 'E');
}
#endif
#ifdef DYNAMIC_ENV_FETCH
HvNAME(hv) = savepv(ENV_HV_NAME);
#endif
for (; *env; env++) {
if (!(s = strchr(*env,'=')))
continue;
*s++ = '\0';
sv = newSVpv(s--,0);
sv_magic(sv, sv, 'e', *env, s - *env);
(void)hv_store(hv, *env, s - *env, sv, 0);
*s = '=';
}
hv_magic(hv, envgv, 'E');
...
-----------------------------------------------------------
Note there are 2 lines that are 'hv_magic(hv, envgv, 'E');'.
When VMS is not defined and env != environ, the %ENV hash can't be sliced.
When the first 'hv_magic(hv, envgv, 'E');' is commented out it works correctly.




-- Doug