$ touch test; # create the dummy $ perl -Mstrict -Wle 'undef $!; open my $fh, "<", "test" or warn "warn : $!"; print "after : $!"' after : Inappropriate ioctl for device $ rm test; $perl -Mstrict -Wle 'undef $!; open my $fh, "<", "test" or warn "warn : $!"; print "after : $!" warn : No such file or directory at -e line 1. after : No such file or directory