use constant (); # load this now for use in later BEGIN blocks
+use Carp qw(cluck); # for stack trace on error in ftp_syslog
+
use FindBin;
use File::Spec;
# The syslog function is pretty picky, and (sometimes) dies silently
# when using non-valid syslog priorities.
- # That's why we run it inside an eval, and print out any errors to STDERR.
- eval {
- syslog($priority, $message);
- };
- if ($@) {
- print STDERR "$@\n";
- }
+ # That's why we run it inside an eval, with errors printed to STDERR,
+ # complete with stack backtrace.
+ eval { syslog($priority, $message) };
+ cluck($@) if $@;
}
sub ftp_warn($) {