X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fsyslog.pl;h=f0dbb1c96a2078a8d4401eb084b6c9cf723ffb2d;hb=c69adce39458d65db6bf9adbc7d99cf7524bd8ee;hp=614068e7fc039942e6d1fe95d65eb1289b5649e8;hpb=8e4ea0b466a4933c45646f1d6fefe96c799d2a72;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/syslog.pl b/lib/syslog.pl index 614068e..f0dbb1c 100644 --- a/lib/syslog.pl +++ b/lib/syslog.pl @@ -29,10 +29,12 @@ package syslog; +use warnings::register; + $host = 'localhost' unless $host; # set $syslog'host to change -if ($] >= 5) { - warn "You should 'use Sys::Syslog' instead; continuing" # if $^W +if ($] >= 5 && warnings::enabled()) { + warnings::warn("You should 'use Sys::Syslog' instead; continuing"); } require 'syslog.ph'; @@ -140,10 +142,10 @@ sub main'syslog { sub xlate { local($name) = @_; - $name =~ y/a-z/A-Z/; + $name = uc $name; $name = "LOG_$name" unless $name =~ /^LOG_/; $name = "syslog'$name"; - eval(&$name) || -1; + defined &$name ? &$name : -1; } sub connect {