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

Hello,

I inherited a windows-based program written in perl and using GTK. I'm trying to figure out how to install / recreate this system on a new Windows XP install.

I have the program running but when I try to set the printers, it fails to see any printers and the perl window shows the error:

*** unhandled exception in callback: *** Undefined subroutine &Win32::Printer::Enum::Printers called at Shi +p_program/Printing.pm line 513. *** ignoring at .\connect.pl line 17.

I tried to install Win32::Printer from CPAN, Win32-Printer-0.9.1, but it wasn't finding 'make' or 'nmake' so I installed 'nmake' and now nmake gives a fatal error, package 'cl' not found. I tried installing MinGW and Visual Studio but got frustrated with this avenue because I kept getting the same error no matter what.(clearly I am not a windows guy!!)

So I tried just copying over the Printer folder from the existing computer, which has the Enum.pm in there, from/to 'C:/Perl/site/lib/Win32/Printer', but it still gives me the same undefined sub when i hit printer preferences.

I tried copying over the PATH environment variables but still no luck.

Any ideas what's going wrong, any suggestions? Do I need to get Win32-Printer to install properly? thank you very much in advance for any help!

Replies are listed 'Best First'.
Re: need help setting up an existing perl program in windows
by Corion (Patriarch) on Apr 12, 2013 at 17:50 UTC

    See A guide to installing modules for Win32 for the easiest approach of using PPM (with ActiveState Perl).

    Otherwise, you will need a C compiler matching the version your Perl installation was compiled with.

    For example, Strawberry Perl comes with its C compiler suite included. For ActiveState Perl, you can install the C compiler from MinGW package by issuing the ppm MinGW command.

      Thanks Corion!

      hmm ppm MinGW gives me "Unknown or ambiguous command"

      I'm sorry I didn't mention that I did try ppm, like this in the beginning:

      ppm install Win32-API ppm install Win32

      But that didn't resolve this issue. I try ppm search Win32::Printer and there is nothing found, I try ppm search Win32 and there are many items displayed but none that have "Printer" in the name

      So it seems I am still stuck here.

        hmm ppm MinGW gives me "Unknown or ambiguous command"
        How about ppm install MinGW -- you neglected to include the command.

        Update: Missed that parent was just following instructions listed. Nothing to see here.

        --MidLifeXis

Re: need help setting up an existing perl program in windows
by fishmonger (Chaplain) on Apr 12, 2013 at 18:45 UTC
      ppm install http://www.bribes.org/perl/ppm/Win32-Printer.ppd

        Thank you fishmonger!! you are my hero!!!