Installing cURL modules for Perl on Windows -


i have activeperl 5.14.2 on windows machine. have been trying install lwp curl module. have installed libcurl-dev library , gcc on machine.

i understand lwp curl has dependency on www-curl-easy module. installed too. installed these through command lines using steps given in readme files. ran perl makefile.pl command followed make , make install. no errors given out during installation.

i trying execute sample code test lwp curl installation:

    use lwp::curl;     use strict;     use warnings;      $lwpcurl = lwp::curl->new();     $content = $lwpcurl->get('http://search.cpan.org','http://www.cpan.org');  

i receiving below error:

can't locate loadable object module www::curl in @inc (@inc contains: c:/perl64/site/lib c:/perl64/lib .) @ c:/perl64/site/lib/www/curl.pm line 11. begin failed--compilation aborted @ c:/perl64/site/lib/www/curl.pm line 11. compilation failed in require @ c:/perl64/site/lib/www/curl/easy.pm line 9. compilation failed in require @ c:/perl64/site/lib/lwp/curl.pm line 5. begin failed--compilation aborted @ c:/perl64/site/lib/lwp/curl.pm line 5. compilation failed in require @ d:\varsha\curl.pl line 1. begin failed--compilation aborted @ d:\varsha\curl.pl line 1.

where going wrong?

the error means www::curl either not installed or path not searchable (it's not in @inc). solutions are

  1. make sure module installed.
  2. add path module installed @inc. since on windows, can use set perl5lib = c:\path\to\dir

for permanent solution follow below:

right-click my computer , click properties.

in system properties window, click on advanced tab.

in advanced section, click environment variables button.

in environment variables window in "user variables foo bar" section click on new , type in following:

variable name: perl5lib

variable value: c:\path\to\dir

then click ok 3 times. windows open after know new variable. type in command window, see newly set value:

echo %perl5lib% 

this add private /home/foobar/code directory (or c:\path\to\dir directory) beginning of @inc every script executed in same environment.

also see: installing perl dependency automatically in perl


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -