in reply to calling ioctl

If you can get the information you need from lsusb, then just use that:
my @output=`lsusb`;
or
open LSUSB, "lsusb |" || die "call to lsusb failed: $!"; while (<LSUSB>) { # find what you are looking for }