Ok so to real quick this I am not the most experienced perl programmer having only dug into it as needed. And well recently I needed it for something


So I have a script doing a series of system updates for a large user base. The only guarantee I have is solaris 10, unidata installed, and perl 5.10 or greater. Part of what I need to do is run some scripts against the unidata data. Withour JDBC installed for unidata it leaves me with a command line option only for getting a short data set and running a few other commands against it.


So in typical the command would look something like this

(cd $unidatadir;udt $command)


Running in a subshell is the cleanest way to do this IMO because of the cd to the directory requirement. The problem is in order to do it properly the environment variables DASP and DASU need to be set which are for an encrypted password and username respectively.


So right now my command also before the cd is setting the env variables for the subshell.

I guess what I am wondering if anyone has a perhaps cleaner way to do this as it seems slightly fragile to me for when it is distributed


Ken

In reply to Set env variables as part of a command by devilock76

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.