Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Problems installing CPAN Win32::Clipboard for Strawberry Perl under Windows Vista

by pela (Initiate)
on Feb 03, 2011 at 20:43 UTC ( #886067=perlquestion: print w/ replies, xml ) Need Help??
pela has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I appologize if the answer to this question is already somewhere in the perlmonks pages, but I have spent the whole day trying to find a solution to the problem on the internet, and now I'm tired of searching. So I hope you can help me anyway... :)

My Perl experience is that I have successfully written perl scripts and run them both under Linux and Windows, but I have never installed Perl (until today) and I have never installed modules. So my question may be stupid. I hope to learn more here.

The question: what steps are needed to install CPAN's Win32::Clipboard for Strawberry Perl under Windows Vista? I have unsuccessfully tried the CPAN Client, and also tried do download and dmake manually.

In the CPAN Client approach, I did the following. I started the CPAN Client by clicking the Start button and then All Programs->Strawberry Perl->Tools->CPAN Client. In the CPAN client I wrote get Win32::Clipboard (I have also tried install and some other alternatives instead of get.) The response is

cpan> get Win32::Clipboard Fetching with LWP: http://cpan.strawberryperl.com/authors/01mailrc.txt.gz LWP failed with code[500] message[read timeout] Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01 +mailrc.txt .gz.tmp6128'. Giving up on it. Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01 +mailrc.txt .gz.tmp6128'. Giving up on it. As a last resort we now switch to the external ftp command 'C:\WINDOWS +\system32\ ftp.EXE' to get 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp6128'. Doing so often leads to problems that are hard to diagnose. If you're the victim of such problems, please consider unsetting the ftp config variable with o conf ftp "" o conf commit Fetching with LWP: http://cpan.strawberryperl.com/authors/01mailrc.txt.gz LWP failed with code[500] message[read timeout] Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01 +mailrc.txt .gz.tmp6128'. Giving up on it. Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01 +mailrc.txt .gz.tmp6128'. Giving up on it. As a last resort we now switch to the external ftp command 'C:\WINDOWS +\system32\ ftp.EXE' to get 'C:\strawberry\cpan\sources\authors\01mailrc.txt.gz.tmp6128'. Doing so often leads to problems that are hard to diagnose. If you're the victim of such problems, please consider unsetting the ftp config variable with o conf ftp "" o conf commit Please check, if the URLs I found in your configuration file (http://cpan.strawberryperl.com/) are valid. The urllist can be edited +. E.g. with 'o conf urllist push ftp://myurl/' Could not fetch authors/01mailrc.txt.gz cpan>
So CPAN client isn't able to download http://cpan.strawberryperl.com/authors/01mailrc.txt.gz . Why? I'm not behind a proxy, I have tried with the firewall disabled, and there's no problem getting the file with Internet Explorer. Somewhere on the web I found a tip that if there is an environment variable called FTP_DISABLE or something (but that's a Linux variable I guess, not a Windows one?). I checked and found a system variable called FTP_PASSIVE, which had the value 1. I changed to 0, but no success. What does that variable mean? (I know, that's not a Perl question, but I guess Monks know everything... :-) ) And why is that file needed? When I got it with IE and uncompressed it, it just contained a bunch of aliases and email addresses.

I gave up and tried downloading and uncompressing the module manually instead. In the uncompressed directory, where Makefile.pl etc are, I did

>perl makefile.pl Writing Makefile for Win32::Clipboard >dmake cp Clipboard.pm blib\lib\Win32\Clipboard.pm C:\strawberry\perl\bin\perl.exe -IC:\strawberry\perl\lib -IC:\strawber +ry\perl\lib C:\strawberry\perl\lib\ExtUtils\xsubpp -typemap C:\straw +berry\perl\lib\ExtUtils\typemap Clipboard.xs>xstmp.c && C:\strawberry +\perl\bin\perl.exe -MExtUtils::Command -e "mv" -- xstmp.c Clipboard.c +pp gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE - +DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms- +bitfields -DPERL_MSVC RT_READFIX -s -O2 -DVERSION=\"0.56\" -DXS_VERSION=\"0.56\" + "-IC:\str awberry\perl\lib\CORE" Clipboard.cpp Det går inte att köra det angivna programmet. dmake: Error code 129, while making 'Clipboard.o'
"Det går inte att köra det angivna programmet." means "Unable to run the given program". Maybe the command line is too long, I believe max is 256 characters in Windows.

How do others do?

Comment on Problems installing CPAN Win32::Clipboard for Strawberry Perl under Windows Vista
Select or Download Code
Re: Problems installing CPAN Win32::Clipboard for Strawberry Perl under Windows Vista
by Anonymous Monk on Feb 03, 2011 at 21:26 UTC
Re: Problems installing CPAN Win32::Clipboard for Strawberry Perl under Windows Vista
by BrowserUk (Pope) on Feb 03, 2011 at 21:29 UTC
    "Det går inte att köra det angivna programmet." means "Unable to run the given program". Maybe the command line is too long, I believe max is 256 characters in Windows.

    I don't use Strawberry Perl, so I can't help you with that, but I can save you chasing the 'too long command line' theory.

    The limit of command line length in cmd.exe on Vista is 8190 characters.

    To me that suggests the above error means it cannot find gcc in your path.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re: Problems installing CPAN Win32::Clipboard for Strawberry Perl under Windows Vista
by Anonymous Monk on Feb 03, 2011 at 21:40 UTC
Re: Problems installing CPAN Win32::Clipboard for Strawberry Perl under Windows Vista
by Anonymous Monk on Feb 03, 2011 at 22:00 UTC
    Why? I'm not behind a proxy ... FTP_PASSIVE

    I have FTP_PASSIVE set, and I have no problems like that. Check %ENV for other potential troublemakers

    perl -le " print qq!$_ = $ENV{$_}! for grep /HTTP|FTP|LWP|NET|PERL/i , + keys %ENV"
Re: Problems installing CPAN Win32::Clipboard for Strawberry Perl under Windows Vista
by syphilis (Canon) on Feb 04, 2011 at 00:10 UTC
    Running 'dmake' should have worked for you - it does for me with Strawberry Perl and Win32::Clipboard-0.56. (Update: I'm also running Windows Vista.)
    First thing to do is (as already suggested) check that gcc is locatable - by running, eg, gcc -v

    Other than that, the only thing I notice is that the output you posted indcates that perl Makefile.PL (and perhaps dmake, too) had been run earlier in that directory. When trying a re-build of a module in the same source directory, start with dmake realclean before running perl Makefile.PL
    However, I doubt that will make any difference in this case.

    Cheers,
    Rob
Re: Problems installing CPAN Win32::Clipboard for Strawberry Perl under Windows Vista
by bart (Canon) on Feb 04, 2011 at 15:09 UTC
    Warning: no success downloading 'C:\strawberry\cpan\sources\authors\01mailrc.txt
    It looks like you are having network problems: CPAN doesn't have access to the CPAN repository. If the site isn't offline, it might be your PC's firewall blocking you.

    BTW you'd have the exact same problems trying to install any other module with CPAN.

      Hi again Monks,

      The installation problem has now been solved.

      Anonymous Monk on Feb 03, 2011 at 21:40 UTC put me on the right track. Before I posted my question, I had already checked if gcc was in my path by typing just gcc with no arguments. cmd.exe didn't complain about unknown command, instead gcc complained about not getting an input file, so I knew gcc was in my path. After posting my question and reading all answers, I followed the tip from the anonymous monk to type gcc -v instead, and that revealed something! It didn't say anything about MingW gcc (MingW is installed with the Strawberry Perl package), instead it said DJGPP gcc! Then I remembered that I installed DJGPP gcc port (http://www.delorie.com/djgpp/) a long time ago. When I checked the path variable, I saw that the directory with DJGPP's gcc.exe came before the directory of MingW's gcc.exe. I put DJGPP's directories last in the path variable, and then installing the CPAN packages worked. It was the wrong gcc used. Arghhh...!

      The CPAN Client still doesn't work, but I don't care now that manual downloading and installing works.

      Anonymous Monk on Feb 03, 2011 at 21:26 UTC suggested cpanp. I had never heard of cpanp before. Now I have, and might try it some time. Thanks!

      BrowserUk, before there was tight limitation for the command line in Windows. I didn't know they had improved that in Vista. Now I know. Thanks!

      Anonymous Monk on Feb 03, 2011 at 21:40 UTC; I meant the character limitation in cmd.exe . I never thought of that there might be a limitation in dmake as well. Thanks!

      Anonymous Monk on Feb 03, 2011 at 22:00 UTC; your script only returned FTP_PASSIVE = 0. Thanks!

      syphilis, thanks!

      bart, I wrote that I had already tried turning the firewall off. But I wrote a lot, so it might have been easy to miss. Thanks!

      All of this started when I wanted to make a small utility that uses the clipboard. My first thought was to do it in Qt C++, but I realized that colleages would complain and say "Why didn't you do it in Perl, it's much quicker to do things in Perl". So I better do it quickly in Perl, but after spending a whole day struggling with the CPAN Clipboard module I was about to give up and do it in Qt C++ anyway. It was just a last desperate thing to post a question here, but I didn'r really expect any answers. But the next morning there was five answers, and then more showed up! That gave me new energy to try more. Perlmonks is really a great place! Thanks a lot!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://886067]
Approved by sierpinski
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (12)
As of 2014-08-22 15:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (159 votes), past polls