if you're "putting things in wierd places", you'll always run into trouble with what you're attempting to do.
you'll have to change the attempts to modify $ENV{PATH}, or have a long list of directories to attempt to shift into $ENV{PATH}.
I think you need to go back and look at design specs. if you can't depend on the location of the external program, maybe you shouldn't be using it. . . . | [reply] |
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. | [reply] [d/l] |