Next | Tricks of the Wizards | 212 |
unless (open LOG, ">> $LOGFILE") { warn "Couldn't append to $LOGFILE: $!"; return; }
This is a very common locution.
Perhaps you might prefer this:
return warn "Couldn't append to $LOGFILE: $!" unless open LOG, ">> $LOGFILE";
That returns 1 on an open failure---perhaps not what you want.
return !warn "Couldn't append to $LOGFILE: $!" unless open LOG, ">> $LOGFILE";
Next | Copyright © 2003 M. J. Dominus |