in reply to Re^3: Perl cheat sheet
in thread Perl cheat sheet
$! was an unfortunate choice of variable. :-) It's a dualvar so it has different values if treated as a string or as a numerical.
It's better to just create a copy and pass that, if the subroutine doesn't copy the argument.open my $fh, '<', 'this does not exist'; printf "%s (%d)\n", $!, $!; __END__ No such file or directory (2)