use lib qw(~/www/cgi-bin);
use SOAP::Lite;
It works great for my shared hosting account that have no SOAP::Lite installed. On hosts with an older installed SOAP::Lite module (Buggy .51 release) the script used that module instead of the one I include using the lines above.
How do I get Perl to use the module I include instead of the system one?
BEGIN { unshift @INC, ... } is what use libdoes already.
So it should already be working for you. You might dump out the contents of @INC before your
use Soap::Liteto see what the include path really is.
Something like this will dump the @INC path to the error log or stderr:
use lib qw(~/www/cgi-bin);
BEGIN { use Data::Dumper; print STDERR Dumper(\@INC); }
use SOAP::Lite;
I changed the use lines to be:
use lib qw(.);
use SOAP::Lite;
so that it could find the SOAP files in /cgi-bin/SOAP from where the script executes /cgi-bin.
It's certainly not the "right way to do things"(TM), but it is very portable for use on many sites and file structures.