I forgot to mention, I already took $! out of that code. I am still a little confused by why I would get a message about inappropriate use of ioctl in one script but not another.
Also, I just checked the rest of my code and removed all the other inappropriate uses of ioctl that I could find. All those that are left are with opens.
My OS is Debian 10 (Buster); my perl versions are 5.28.1 local and 5.16.3 or 5.30.0 on web host depending on the shebang.