Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

RE: RE: Adding a directory to $ENV{PATH}

by amelinda (Friar)
on Nov 03, 2000 at 04:22 UTC ( [id://39788]=note: print w/replies, xml ) Need Help??


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

It might not be there. Sometimes admins put things in weird places (I should know, I am one), and I'd rather code in more choice than less.

I figured that @INC might not work, because the node I borrowed the idea from was talking about a module, but it was worth a try.

  • Comment on RE: RE: Adding a directory to $ENV{PATH}

Replies are listed 'Best First'.
RE: RE: RE: Adding a directory to $ENV{PATH}
by geektron (Curate) on Nov 03, 2000 at 05:27 UTC
    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. . . .

      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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://39788]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-19 17:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found