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

I am trying to implement the Win32::Printer mod and I get this error when testing the syntax.

Can't locate loadable object for module Win32::Printer in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .)

Any ideas what it is talking about? I have downloaded and copied every file in the zip file over to the Win32 directory in the Perl lib directory and I get this error.

Replies are listed 'Best First'.
Re: Win32::Printer loadable object module?
by PodMaster (Abbot) on Jan 07, 2004 at 09:14 UTC
    I have downloaded and copied every file in the zip file over to the Win32 directory in the Perl lib directory and I get this error.
    Why would you do a thing like that? Sure Win32-Printer doesn't have a README or INSTALL file, but the distribution is on CPAN and has a Makefile.PL. Now would be a good time to read A Guide to installing modules in Tutorials as well as perlmodinstall.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      I have run the make file but I was under the impression that these makes files were only for *nix platforms which I am not trying to install it on. I use apt-get for all my Linux installs and yes sometimes use the source and make, make test, and make install but this is being installed on a Win32 system.

      I simply copied over the module because this is all that is generally needed for most modules. If a module has specific requirements for install there should be an INSTALL.txt or a README or something.

      Update:

      I got the pre-compiled binary from www.wasx.net. Simply copy over the contents to the proper directory and it works (or at least no more error).

        I have run the make file but I was under the impression that these makes files were only for *nix platforms which I am not trying to install it on.
        Nope, it's not just for nix. That is the standard way to install perl modules (especially ones on CPAN).

        I simply copied over the module because this is all that is generally needed for most modules.
        In theory for pure-perl modules maybe, but by doing so you always miss out on the important work a module author does (making sure you have all the prerequisites, making sure the module will work(tests) ...).

        If a module has specific requirements for install there should be an INSTALL.txt or a README or something.
        Normally I'd agree with you, but seing how you got the distribution from CPAN, and it is a standard CPAN distribution despite the lacking README/INSTALL file, the installation instructions are the same as that of any standard cpan distribution (perlmodinstall - Installing CPAN Modules).

        MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
        I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
        ** The third rule of perl club is a statement of fact: pod is sexy.

Re: Win32::Printer loadable object module?
by Anonymous Monk on Jan 06, 2004 at 23:15 UTC
    I had a similar problem with Win32::API. What I eventually found out was that the .xs files need to be complied in order to install them, so just copying the files doesn’t work. Trying to figure out how to compile it hurt my brain.

    What you can do instead is type “ppm” from a DOS prompt. While in ppm, you can type “search Win32*” and it will list all of the available Win32 modules. If you see Win32-Printer in the list, then you can type “install Win32-Printer” and it will install the Win32::Printer module.

    I have no idea how this magic works, so if anyone would care to enlighten me, it would be greatly appreciated.

      Thanks for the suggestion but Win32-Printer is not found in a ppm search. Thus my dilemma.