Hello Everyone! can someone help me with this problem:

I Bought an usb-to-parallel port adapter (lsusb give me Bus 001 Device 002: ID 067b:2305 Prolific Technology, Inc. PL2305 Parallel Port), and Linux recognize it as /dev/usb/lp0

dmesg:
[ 35.125223] usblp0: USB Bidirectional printer dev 2 if 0 alt 1 prot +o 2 vid 0x067B pid 0x2305 [ 35.125307] usbcore: registered new interface driver usblp
now the problem: both the modules Device::ParallelPort::drv::parport and Device::ParallelPort::drv::linux that i tried in perl gave me this error for the first module:
Device::ParallelPort unabel to create driver parport (see Device::Para +llelPort::drv::auto for further information) - Failed to load partpor +t driver for /dev/usb/lp0 at (eval 1) line 3 at ./parportcontroller line 5
and this for the second:
Use of uninitialized value in subroutine entry at /usr/local/lib/perl/ +5.10.0/Device/ParallelPort/drv/linux.pm line 68.
I Tried to hard code in the second module the device character file at line 68
$this->{DATA}{BASE} = linux_opendev("/dev/usb/lp0");
but this didn't work, the result is that my script doesn't set or get any bit from the parallel port. Here is my code:
#!/usr/bin/perl -w use Device::ParallelPort; my $port = Device::ParallelPort->new('linux'); if($port){ print "Bit 0: ".$port->get_bit(1)."\n"; $port->set_bit(1, 0); print "Bit 0: ".$port->get_bit(1)."\n"; } else { die "Errore sul driver\n"; }
and this is the result:
Use of uninitialized value in subroutine entry at /usr/local/lib/perl/ +5.10.0/Device/ParallelPort/drv/linux.pm line 68. Bit 0: 1 Bit 0: 1
The Device::ParallelPort::drv::parport module give me the error above. Someone can help me? Thanks, and sorry for my bad english XD

In reply to use Perl With usblp Parallel Adapter by Morzilla

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.