I suspect your script is printing the value $!via open && die $!or open or die $!; print $!;.
The following is a minimal script that reproduces the same problem on Windows:
C:\> perl -e "open my $fh, '<', 'file_that_opens' && die $!"
Inappropriate I/O control operation
And this is what happens on * nix:
$ perl -e 'open my $fh, "<", "file_that_opens" && die $!'
Inappropriate ioctl for device
This behavior is documented.
perldoc perlvar, $! . open, $!, , open :
... $! :
if (open my $fh, "<", $filename) {
...
}
else {
...
}
, $! open().