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/