My computer is running Windows 7. About a week ago I downloaded and installed Strawberry Perl 5.18.2.2 (64bit) for Windows XP or higher. I had no problem running this new version until I tried to include "use win32::Clipboard;".
The module Clipboard.pm was part of that recent download and is located on my computer at C:\strawberry\win32\Clipboard\Clipboard.pm. Note that in this full path all letters are lower case except for the three instances of "C".
If I print out the existing contents of @INC, the result is these three directories: C:/strawberry/perl/site/lib C:/strawberry/perl/vendor/lib C:/strawberry/perl/lib
Since "C:/strawberry/win32/Clipboard" was not in the original "@INC", I knew that I had to add that directory in order to "Use win32::Clipboard;" and so I employed the "BEGIN" command on the second line of this simple program in order to do that.
#!C:\strawberry\perl\bin\perl - w
BEGIN {unshift @INC, "C:/strawberry/win32/Clipboard"}
use strict;
foreach (@INC)
{
print "$_\n";
}
<STDIN>;
This simple program runs without error and does move the path "C:/strawberry/win32/Clipboard" into @INC as proved by printing out the contents of @INC after the BEGIN command, which yields this: C:/strawberry/win32/Clipboard C:/strawberry/perl/site/lib C:/strawberry/perl/vendor/lib C:/strawberry/perl/lib
Since I had managed to get "C:/strawberry/win32/Clipboard" into @INC, I thought that I could now "use win32::Clipboard;" and so I added that line to the program to make this new version:
#!C:\strawberry\perl\bin\perl - w
BEGIN {unshift @INC, "C:/strawberry/win32/Clipboard"}
use Win32::Clipboard; # NOTE that in this line I have also tried "use Win32::Clipboard::Clipboard;" and "use Clipboard::Clipboard;" without success.
use strict;
foreach (@INC)
{
print "$_\n";
}
<STDIN>;
Adding the new line, "use Win32::Clipboard;", caused this error when I ran the program.
"Can't locate Win32/Clipboard.pm in @INC (you may need to install the Win32::Clipboard module) (@INC contains: C:/strawberry/win32/Clipboard C:/strawberry/perl/site/lib C:/strawberry/perl/vendor/lib C:/strawberry/perl/lib .) at print_inc_array.pl line 5. BEGIN failed--compilation aborted at print_inc_array1.pl at line 5."
Even though, I have looked at a lot of examples on the Internet that are claimed to be correct ways to do this, none of them work for me. I have not been able to figure out what is wrong with this simple program, whose purpose is only to find out how to code for the module Clipboard.pm so that I can then code that module in practical programs. Again, I have tried changing the "use" line to "use Win32::Clipboard::Clipboard;" and to "use Clipboard::Clipboard;" without success. Any help would be appreciated.
Thank you,
Reef Alive
C:/strawberry/
? - Jens