in reply to Re: How to manipulate @INC in a script?
in thread How to manipulate @INC in a script?

In addition to use lib, you can also use -I<path> on the command line like:
$ /usr/bin/perl -I"/home/me/lib" myscript.pl
or in your shebang line like:
#!/usr/bin/perl -I"/home/me/lib"
--
$me = rand($hacker{perl});

All code, unless otherwise noted, is untested

Replies are listed 'Best First'.
Re^3: How to manipulate @INC in a script?
by gothic_mallard (Pilgrim) on Sep 22, 2004 at 07:50 UTC

    Don't know if this is true just of Win32 (running ActivePerl 5.6.1 (633)) but if you use quotes in the shebang line it doesn't work.

    i.e.

    #!/usr/bin/perl -I"/somedir/"

    ..won't work but

    #!/usr/bin/perl -I/somedir/

    .. will.

    The /usr/bin/perl wouldn't be strictly correct on Win32, but under ActivePerl it doesn't seem to matter (could set it to the proper DOS path if required).