Win32::API->Import('libusb0', 'usb_open',"I","P") or die $^E; Win32::API::Struct->typedef( 'usb_device', "LPLONG","next", "LPLONG","prev", "CHAR","filename", # hat 512 byte "LPLONG","usb_bus", "CHAR","bLength", "CHAR","bDescriptorType", "SHORT","bcdUSB", "CHAR","bDeviceClass", "CHAR","bDeviceSubClass", "CHAR","bDeviceProtocol", "CHAR","bMaxPacketSize0", "SHORT","idVendor", "SHORT","idProduct", "SHORT","bcdDevice", "CHAR","iManufacturer", "CHAR","iProduct", "CHAR","iSerialNumber", "CHAR","bNumConfigurations", "LPLONG","config", "VOID","dev", "CHAR","devnum", "CHAR","num_children", "LPLONG","children" ); my $dev = Win32::API::Struct->new( 'usb_device'); foreach my $key(keys %usb_device){ $dev->{$key} = $usb_device{$key}} usb_open($dev);