in reply to How do I use a module?

Thank you to everyone that replied.

Looks like it is working, thanks to your help, and some guessing, and checking. I will include the unsuccessful steps I took, in case they may have done something that was necessary.

Unsuccessful steps.

  1. Ran cpan install Win32::Clipboard: The installation appeared to be successful, but the Error: Can't locate loadable object for module Win32::Clipboard remained.
  2. I removed Clipboard.pm from the \perl\lib folder, then tried cpan install Win32::Clipboard again. This time, it failed to install, with error Failed 1/1 test programs. 1/9 subtests failed.

Successful Steps.

  1. I placed Clipboard.xs in the \perl\lib folder
  2. I changed the extension on Clipboard.xs to Clipboard.pm.
  3. Ran cpan install Win32::Clipboard: This time the installation appeared to succeed, and the perl script appeared to access the clipboard.

Follow-up Question

Am I using the .xs file in the intended manner? My guess would be that the .xs file might be a version of the pm file, made for people that don't have C++ on their systems. Is it supposed to be renamed as a .pm file, or am I doing something weird?

Replies are listed 'Best First'.
Re^2: How do I use a module?
by bulk88 (Priest) on Mar 27, 2014 at 02:59 UTC

    Unsuccessful steps.

    1. Ran cpan install Win32::Clipboard: The installation appeared to be successful, but the Error: Can't locate loadable object for module Win32::Clipboard remained.
    2. I removed Clipboard.pm from the \perl\lib folder, then tried cpan install Win32::Clipboard again. This time, it failed to install, with error Failed 1/1 test programs. 1/9 subtests failed.


    Why dont you post the full log? You obviously aren't compiling C code.

    Am I using the .xs file in the intended manner? My guess would be that the .xs file might be a version of the pm file, made for people that don't have C++ on their systems. Is it supposed to be renamed as a .pm file, or am I doing something weird?

    I suggest you read that .xs file and decide if it written in Perl language or not and report back with your answer ;)
Re^2: How do I use a module?
by Anonymous Monk on Mar 27, 2014 at 03:23 UTC
    Well, I believe most of your problem stem from manual copying of files, all willy nilly :)