in reply to Help using ioctl to write a PCI device

You're not checking the return value from any of your calls. Add an ... or die "open /dev/pcimax failed: $!\n"; (adjusted approriately) and see if that's enlightening.