One subtlety with die (and warn) 

die "Can't open log file\n";
Can't open log file
print STDERR "Can't open log file\n";
exit 1;