English 中文(简体)
Is there a way to identify a USB pnp event in Perl code on Windows?
原标题:

Is anyone familiar with how to identify a USB pnp event with Perl on a Windows (win32 system)?

There is Device::USB (Use libusb to access USB devices) but it suitable for linux, and in order to work in Windows it require libusb and even that not require it to works, is there any other option to identify if a USB device is plugged or unplugged on a Win32 system with Perl? If yes, could someone show an example?

问题回答

Device::USB under Win32 has bugs... and it crashes perl.exe :-) never got that before ;-) but i need this package and i hope the bugs will soon be fixed!

I think the biggest problem for the package is Inline::C

The most problems come when you receive large amounts of data (>10 bytes). One of the first things I removed was the pakage Carp, it does more bad than good with this package under win32.

Anyone got it working good under WinXP?!

Greetings

Christian Netherlands

One of the (Out of Memory!? LOL) bugs from Device::USB package:

Out of memory! 
Software error:
Callback called exit at C:/Perl/lib/AutoLoader.pm line 27,  line 1.

For help, please send mail to this site s webmaster, giving this error message and the time and date of the error. 

[Wed Feb 24 15:21:04 2010] AutoLoader.pm: Callback called exit at C:/Perl/lib/AutoLoader.pm line 27, line 1. 

A solution for running the script trough ISS is using undef *DATA; but it isnt the most clean option, its a bit dirty ;-)! but for now it is working... (i hope)

: ( More Errors:

Free to wrong pool 2441d8 not 20100 during global destruction.




相关问题
Why does my chdir to a filehandle not work in Perl?

When I try a "chdir" with a filehandle as argument, "chdir" returns 0 and a pwd returns still the same directory. Should that be so? I tried this, because in the documentation to chdir I found: "...

How do I use GetOptions to get the default argument?

I ve read the doc for GetOptions but I can t seem to find what I need... (maybe I am blind) What I want to do is to parse command line like this myperlscript.pl -mode [sth] [inputfile] I can use ...

Object-Oriented Perl constructor syntax and named parameters

I m a little confused about what is going on in Perl constructors. I found these two examples perldoc perlbot. package Foo; #In Perl, the constructor is just a subroutine called new. sub new { #I ...

Where can I find object-oriented Perl tutorials? [closed]

A Google search yields a number of results - but which ones are the best? The Perl site appears to contain two - perlboot and perltoot. I m reading these now, but what else is out there? Note: I ve ...

热门标签