From: Jim Schneider Date: Fri, 5 Mar 2004 14:03:10 +0000 (-0500) Subject: Allow syslog() to use numeric constants in addition to strings for X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b9f13614400d2300b9be70f1589bc5e1a203e67b;p=p5sagit%2Fp5-mst-13.2.git Allow syslog() to use numeric constants in addition to strings for facility names and priorities. Subject: Patch for Sys::Syslog Message-Id: <200403051403.10674.jschneid@netilla.com> p4raw-id: //depot/perl@22451 --- diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm index 13598e7..244157f 100644 --- a/ext/Sys/Syslog/Syslog.pm +++ b/ext/Sys/Syslog/Syslog.pm @@ -7,7 +7,7 @@ use Carp; @ISA = qw(Exporter DynaLoader); @EXPORT = qw(openlog closelog setlogmask syslog); @EXPORT_OK = qw(setlogsock); -$VERSION = '0.04'; +$VERSION = '0.05'; # it would be nice to try stream/unix first, since that will be # most efficient. However streams are dodgy - see _syslog_send_stream @@ -394,6 +394,7 @@ sub _syslog_send_socket { sub xlate { local($name) = @_; + return $name+0 if $name =~ /^\s*\d+\s*$/; $name = uc $name; $name = "LOG_$name" unless $name =~ /^LOG_/; $name = "Sys::Syslog::$name";