Long story, but I need to replace a perl that came with an application with my own compiled perl. It needs to be a drop-in binary compatible version, there are a lot of modules and database drivers that need to work. After I figured out how to make @INC to be the same, I can't figure out what is going on with %ENV. I thought that %ENV came from the shell's environment. But apparently not:
[root@jove tmp]# ./newperl -e 'print join " ", keys %ENV;print "\n"'; HOSTTYPE LOGNAME MAIL OSTYPE HOME MANPATH SHLVL OLDPWD PWD PATH SSH_TT +Y TZ PS1 SHELL TERM MACHTYPE ORACLE_HOME _ USER HOSTNAME [root@jove tmp]# ./oldperl -e 'print join " ", keys %ENV;print "\n"'; PX_ANI_PORT CLASSPATH SATMP PX_USER VERSION SVC_ENTRY_DMGT PX_LOGFILE +HOME JAVA_HOME I_MODE PX_OSA_PORT PX_DATASTORE PX_SCLASSDIR PX_GROUP +PX_JRN_PORT OSAGENT_PORT PRODVERS PX_PROTOCOL DMGT_START BASEDIR ASAN +Y PX_BINDIR LANG UPDATE LC_ALL EMAIL PX_WEB_PORT PX_HLPDIR PX_CONFDIR + TZ I_CONF_SYSLOG VENDOR PX_DOCURL CWMIBDIR PX_DMGTHOST NMSROOT PSTAM +P PX_TMPDIR TERM OAMBASE SQLANY PX_DOCDIR PATCHVER SVC_ENTRY_OSA DESC + PKGINST PX_DATADIR NAME PKG ASTMP PX_APPDIR PX_LOGDIR ALIAS PX_PORT +PKGSAV PX_CGIURL PKGOWNER CLASSES SVC_ENTRY_SSL LD_LIBRARY_PATH PX_CL +ASSURLPX_CTRBDIR PRODNAME PX_DMGT_PORT PX_CGIDIR NLSPATH INSTDATE BUI +LD_ID PX_CLASSDIR PX_LIBDIR ARCH CATEGORY PX_HOST SVC_ENTRY_JRN PATH +DMGT_PORT HOTLINE SVC_ENTRY_WEB PX_FACILITY [root@jove tmp]#
Where are all those extra environment variables coming from in oldperl?

In reply to Where does %ENV come from? by permanentE

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.