You'll first have to decide if you want the current directory to end up in the beginning or in the end of your @INC search path. Flame already showed you how to get it in the end of @INC search path.
I'd definitely recommend doing this in a BEGIN block. That way you're sure it will be available for all modules used by your script. If not, you may loose track of what module uses the modified search path and what module doesn't.
The following will put the 'current directory' first (which is probably what you want in this case).
BEGIN{unshift(@INC,'.');}
Note. This can also be useful if you want to use a specific version of a system wide module on a box where the administrator doesn't want to upgrade to the latest and gratest of the module you're using. Or if they don't want to install that module at all. It will only make sense for no-binary modules, though.
f--k the world!!!!
/dev/world has reached maximal mount count, check forced.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.