Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
That works for only one other directory. Perl doesn't recurse to find an entry that is not directly an element of @INC. All you're doing is moving one of the elements of @INC to a specific different space.

To be specific, suppose I symlink the/home/merlyn/private directory into my site_lib I can't just add MyModule.pm into that directory and call it with everyone's use MyModule. They'd have to say use private::MyModule. The path is affected. It's not recursive, it's a flat search based on the content of @INC followed by the filename derived from the module name.

Now, you could effectively copy every entry that you want directly into the site_lib dir (like putting MyModule.pm directly there). But that's not changing @INC, nor making it more flexible. The only way to do this is to recompile Perl, and we're back to the same old solution.

So, no, this is not "dirty", because it's not even a solution.

-- Randal L. Schwartz, Perl hacker


In reply to •Re: Re: how to include a directory in @INC? by merlyn
in thread how to include a directory in @INC? by aqw001

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 browsing the Monastery: (3)
As of 2024-04-19 21:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found