I'm writing this for some pretty weird specs that I didn't pick, and don't really have control over. I said sometimes admins put things in weird places, I didn't say I did. If I were really going to write this damned thing properly, I'd rewrite it using LWP and Crypt::SSLeay, but one of the BIG constraints is 'don't use modules' because the remote sites that may be using this thing aren't the brightest folks, and we can't make 'em install a buncha modules.

Heck, if it wouldn't be an amazing nightmare, they'd have me writing Crypt::SSLeay (or an equivalent) just so we wouldn't have to rely on these folks installing openssl. Fortunately, that was just too much, so I'm relying on openssl (this is a program that uploads to a secure web server). I'm hoping that it's in the default install directory for openssl, but if it's not in the default path, I want to check that default directory.

I guess I'll just go back to the ugly

chomp($openssl = `which openssl`); if ( !(-X $openssl)) { $openssl = "/usr/local/openssl/bin/openssl";} if ( !(-X $openssl)) { die "openssl required";}
Update: I just re-read this, and it's not really clear what I mean about where I expect openssl to be. Try this instead: I'm hoping that openssl is in the user's PATH already1, but if it's not, I want to check against the default install directory for openssl as a sort of last resort. After all, we have openssl installed in that default install dir, but that dir isn't in my PATH either.

1 Perhaps the word "weird" was misleading. I wouldn't be really surprised if openssl had been installed into, say, /usr/local/bin/ instead. That's why I'd like to check the PATH first. You know what "assume" translates as.

In reply to RE: RE: RE: RE: Adding a directory to $ENV{PATH} by amelinda
in thread Adding a directory to $ENV{PATH} by amelinda

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.