=over =item $OS_ERROR =item $ERRNO =item $! X<$!> X<$ERRNO> X<$OS_ERROR> If used numerically, yields the current value of the C C variable, or in other words, if a system or library call fails, it sets this variable. This means that the value of C<$!> is meaningful only I after a B: if (open my $fh, "<", $filename) { # Here $! is meaningless. ... } else { # ONLY here is $! meaningful. ... # Already here $! might be meaningless. } # Since here we might have either success or failure, # here $! is meaningless. In the above I stands for anything: zero, non-zero, C. A successful system or library call does B set the variable to zero. If used as a string, yields the corresponding system error string. You can assign a number to C<$!> to set I if, for instance, you want C<"$!"> to return the string for error I, or you want to set the exit value for the die() operator. (Mnemonic: What just went bang?) Also see L. =back