in reply to calling ioctl

Calling ioctls is hairy. Well if not hairy, ugly. You're basically going to have to find out how you'd call the same thing from C and then pack up the required structures and unpack the results. You'd probably be better off either doing the C stuff in C and rolling up a quick interface using Inline::C, or in this specific case see if Device::USB can't take care of all the nasty stuff for you out of the box.

The cake is a lie.
The cake is a lie.
The cake is a lie.