http://qs321.pair.com?node_id=734575


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.

open my $fh, '<', 'this does not exist'; printf "%s (%d)\n", $!, $!; __END__ No such file or directory (2)
It's better to just create a copy and pass that, if the subroutine doesn't copy the argument.

lodin