Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Webhost have no standard LWP::Simple module installed. Can I put this module in my cgi-bin directory and run it from? How to modify code to run module?
#!/usr/bin/perl use strict; use warnings; use CGI; use LWP::Simple;

Replies are listed 'Best First'.
Re: run module from cgi-bin
by kutsu (Priest) on Apr 19, 2005 at 16:27 UTC

    You can run it from the cgi-bin or a lib directory either way tachyon's A Guide to Installing Modules Tutorial describes how to do this, under heading "I don't have permission to install a module on the system!".

    "Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce

      I can create this /lib directory only via FTP, and put there a module.

      Is this correct:

      #!/usr/bin/perl -w use strict; use lib '/usr/home/myr_home_dir/lib/'; use warnings; use CGI; use LWP::Simple;

        yes, if you're still having problems I'd check the permissions of the directories leading to lib (other users at least needs read permission)

        "Cogito cogito ergo cogito sum - I think that I think, therefore I think that I am." Ambrose Bierce

Re: run module from cgi-bin
by tlm (Prior) on Apr 19, 2005 at 16:29 UTC

    use lib '.';
    or, more generally,
    use lib '/path/to/add/to/perls/searchpath';

    See lib.

    the lowliest monk

Re: run module from cgi-bin
by sschneid (Deacon) on Apr 19, 2005 at 16:10 UTC
    BEGIN { unshift @INC, './'; }

    -s.