perror This is identical to the C function "perror()", which outputs to the standard error stream the specified message followed by ": " and the current error string. Use the "warn()" function and the "$!" variable instead, see the warn entry in the perlfunc manpage and the section on "$ERRNO" in the perlvar manpage.