MikeL's Perl howto - Device::Parallel

Installing this thing shouldn't be this hard, but it took me quite a while to get it going, so here's my notes. P.S. I was only trying to make this work on Windows XP on an older 32 bit Dell. Just to make clear, these are all steps I took in the process of getting it working, spread across many reboots etc. Hopefully this is a simple direct path to success.

Here's my sample test program, cribbed from the package itself in the synopsis of the Device::ParallelPort package:

use strict;

use Device::ParallelPort;

my $port = Device::ParallelPort->new();

print $port->get_bit(3)."\n";
print ord($port->get_byte(0))."\n";
$port->set_byte(0, chr(255));
(I don't even know yet if this is what it's supposed to do, I'm just documenting what I did to get it this far!) Running this prints:

When I was having problems, I would get a message something like the following [note "unabel" sic]:
Device::ParallelPort unabel to create driver auto (see Device::ParallelPort::drv ::auto for further information) - Device::ParallelPort::drv::auto (auto detect) error failed to load win32 - Can't locate Device/ParallelPort/drv/win32.pm in @INC (@I NC contains: F:/Progs/System/Perl/lib F:/Progs/System/Perl/site/lib .) at (eval 2) line 2. BEGIN failed--compilation aborted at (eval 2) line 2. . Make sure you have loaded and installed Device::ParallelPort::drv::win32 from CPAN. Install Device::ParallelPort::drv::(linux|parport|win32) and try again at (eval 1) line 3 at L:\Page\cgi-bin\lpt.pl line 2

Side notes, questions I asked myself when I was having trouble:

Later addition - got it to work on Windows 7 x64 bit laptop. You must rename inpoutx64.dll to inpout32.dll, then copy this file into the /windows/system32 directory. This computer is printing "1" and "120". I have not looked into the docs yet to see if it's expected that this returns a different number than my other box. Note that this is working without the dock.

Another later addition - now that I got it working on the laptop, I tried all 4 parallel port settings in the BIOS, and there was no difference, even disabled. Options are "Disabled", "AT", "PS2", and "ECP".

Copyright © 1995-2023 Mike Lempriere (running on host pedicel)