Assuming Perl doesn't given an error for trying to execute a directory ("."), it'll launch /bin/sh to execute it. That means using "." is wrong here. You're executing a ksh script in sh.

Each process has it's own environment. While changes are inherited by children, changes don't affect the parent. So while you are changing ksh's environment, your Perl script's environment will remain unchanged.

This has been discussed a number of times before. The solution usually involves printing out the environment and have it parsed by your Perl script.

my @env = `ksh -c '. /path/urmset_01 rp 010101 && set'`; ...

In reply to Re: interaction perl - Korn shell variables by ikegami
in thread interaction perl - Korn shell variables by jevaly

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.