Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Howto set path for local package in a Perl code

by BaldPenguin (Friar)
on Jun 01, 2006 at 17:26 UTC ( [id://553096]=note: print w/replies, xml ) Need Help??


in reply to Howto set path for local package in a Perl code

I offer this as advice and as a question
When faced with this situation, I have always used a flag in my shebang
#!/path/to/perl -I.
Are there issues with doing that?

Don
WHITEPAGES.COM | INC
Everything I've learned in life can be summed up in a small perl script!

Replies are listed 'Best First'.
Re^2: Howto set path for local package in a Perl code
by holli (Abbot) on Jun 01, 2006 at 18:06 UTC
    Are there issues with doing that?
    It can easily fail:
    #!perl -I. #t.pl use strict; use warnings; use XTest; print "ok\n";
    -------
    #XTest.pm package XTest; use strict; use warnings; 1;
    -------
    F:\tmp\test>dir *.p* Directory Listing of F:\tmp\test 01.06.2006 20:02 52 t.pl 01.06.2006 20:02 46 XTest.pm 2 File(s 98 Bytes 0 Directories, 2.727.182.336 Bytes free F:\tmp\test>perl t.pl ok F:\tmp\test>cd .. F:\tmp>perl test\t.pl Can't locate XTest.pm in @INC (@INC contains: F:/Perl/lib F:/Perl/site +/lib .) at test\t.pl line 4. BEGIN failed--compilation aborted at test\t.pl line 4. F:\tmp>


    holli, /regexed monk/

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-03-29 10:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found