Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Installing Win32::Console

by LloydRice (Beadle)
on Nov 28, 2011 at 03:21 UTC ( [id://940297]=perlquestion: print w/replies, xml ) Need Help??

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

I am running Win7 Pro (64 bit) on a Gateway SX-2841. I have installed Active State Perl v5.12.4 and have been writing Perl for a few years. Today, I tried to install the Win32::Console module, with no luck. The first attempt was via cpanminus. The Command window was run in Admin mode. It went like this:
C:\Windows\system32>cpan App::cpanminus It looks like you don't have a C compiler and make utility installed. + Trying to install dmake and the MinGW gcc compiler using the Perl Package Manager. This may take a a few minutes... ppm.bat install failed: Can't find any package that provides MinGW It looks like the installation of dmake and MinGW has failed. You will not be able to run Makefile commands or compile C extension code. Please check your internet connection and your proxy settings! CPAN: Term::ANSIColor loaded ok (v3.00) CPAN: Storable loaded ok (v2.22) Going to read 'C:\Perl64\cpan\Metadata' Database was generated on Sat, 26 Nov 2011 11:28:07 GMT Running install for module 'App::cpanminus' Running make for M/MI/MIYAGAWA/App-cpanminus-1.5005.tar.gz CPAN: Digest::SHA loaded ok (v5.62) CPAN: Compress::Zlib loaded ok (v2.033) Checksum for C:\Perl64\cpan\sources\authors\id\M\MI\MIYAGAWA\App-cpanm +inus-1.5005.tar.gz ok CPAN: Archive::Tar loaded ok (v1.76) App-cpanminus-1.5005/ App-cpanminus-1.5005/bin/ App-cpanminus-1.5005/Changes App-cpanminus-1.5005/lib/ App-cpanminus-1.5005/Makefile.PL App-cpanminus-1.5005/MANIFEST App-cpanminus-1.5005/META.json App-cpanminus-1.5005/META.yml App-cpanminus-1.5005/README App-cpanminus-1.5005/t/ App-cpanminus-1.5005/t/happy_cpantesters.t App-cpanminus-1.5005/lib/App/ App-cpanminus-1.5005/lib/App/cpanminus.pm App-cpanminus-1.5005/bin/cpanm CPAN: File::Temp loaded ok (v0.22) CPAN: Parse::CPAN::Meta loaded ok (v1.4401) CPAN: Module::CoreList loaded ok (v2.50) CPAN.pm: Going to build M/MI/MIYAGAWA/App-cpanminus-1.5005.tar.gz It looks like you don't have a C compiler and make utility installed. Trying to install dmake and the MinGW gcc compiler using the Perl Package Manager. This may take a a few minutes... ppm.bat install failed: Can't find any package that provides MinGW It looks like the installation of dmake and MinGW has failed. You will not be able to run Makefile commands or compile C extension code. Please check your internet connection and your proxy settings! Checking if your kit is complete... Looks good Writing Makefile for App::cpanminus 'nmake' is not recognized as an internal or external command, operable program or batch file. MIYAGAWA/App-cpanminus-1.5005.tar.gz nmake -- NOT OK CPAN: YAML::XS loaded ok (v0.35) Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible C:\Windows\system32>
Next, I tried ppm. The "Perl on Windows" paragraph of "How to Install CPAN modules" appears to suggest that cpanminus should be used with Strawberry and PPM with ActiveState. Did I misread that? Anyway, this run sort of looked like it worked. But no joy.
C:\Windows\system32>ppm install Win32::Console No missing packages to install C:\Windows\system32>
Here is a simple Perl script to see what happened:
C:\Windows\system32>cd \c\perl\console C:\c\Perl\console>type console.pl # Perl script to test keyboard functions use Win32::Console $cons = new Win32::Console STD_INPUT_HANDLE; C:\c\Perl\console>console "Win32::Console=HASH(0x10e7c0)" is not exported by the Win32::Console module. Can't continue after import errors at C:\c\Perl\console\console.pl line 6 BEGIN failed--compilation aborted at C:\c\Perl\console\console.pl line 6. C:\c\Perl\console>
I am now wondering if the "Win32" module is exactly that -- not useable on a 64-bit machine. If that's the problem, is there a 64-bit module that returns scan codes (or raw keyboard data in some other way)?

Perhaps I should add that I've been using Win32::Console on a Win98 system for several years. I hoped it would be a simple matter to get it for Win7.

Replies are listed 'Best First'.
Re: Installing Win32::Console
by NetWallah (Canon) on Nov 28, 2011 at 03:58 UTC
    PPM seems to have worked.

    But you are missing a semicolon, at the end of

    use Win32::Console
    This causes the 'use' to assume that the things you want imported are specified as "$cons", resulting in the error messages.

                "XML is like violence: if it doesn't solve your problem, use more."

      Golly, what a dumb mistake. Thanks. I'll try again.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2024-04-18 06:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found