Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Executing a program from within a Perl Module in a non-standard path ($PATH/%PATH%)

by GoldElite (Sexton)
on Mar 20, 2013 at 11:45 UTC ( #1024500=note: print w/ replies, xml ) Need Help??


in reply to Re: Executing a program from within a Perl Module in a non-standard path ($PATH/%PATH%)
in thread Executing a program from within a Perl Module in a non-standard path

Hmmm. It feels a little heavy-handed to modify the PATH for each potential script/executable after a recursive search, considering I technically know where they are stored (in the directory of the calling project/script, given a heirarchy of projects).

On top of that, since I don't know it explicitly (that's pretty much the entire problem here!), $startdir will always be the cwd, too (or at least $FindBin::Bin), which would be redundant if PathStuffer is used multiple times (the search is probably a negligable impact in this day and age, but still. ;) ).

Also, it's not always the case that a file will be a script (note that 'rdiff' is an executable binary), so just searching for ".pl" doesn't quite cover all use cases. Since *nix binaries don't really have naming conventions (and hence I'd have to search for ".*"), I'd necessarily be including every directory into the path to include it, which just makes me feel dirty. (It probably wasn't obvious that I'm using *nix boxes here, but I'd like to keep the code portable either way)

 

That said, this is certainly still a viable option that I wouldn't have considered otherwise :)


Comment on Re^2: Executing a program from within a Perl Module in a non-standard path ($PATH/%PATH%)
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (14)
As of 2015-07-31 12:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (276 votes), past polls