Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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 :)


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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2024-04-16 07:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found