X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fsyslog.pl;h=70c439b9aeab089d118c9af3978f987708bb5a77;hb=8c99d73ee7ce90de2561496f683f3850d1269e1d;hp=8807ef027dbf2869d726bbe8fc6df5307213d2af;hpb=55497cffdd24c959994f9a8ddd56db8ce85e1c5b;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/syslog.pl b/lib/syslog.pl index 8807ef0..70c439b 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'; @@ -143,7 +145,7 @@ sub xlate { $name = uc $name; $name = "LOG_$name" unless $name =~ /^LOG_/; $name = "syslog'$name"; - eval(&$name) || -1; + defined &$name ? &$name : -1; } sub connect {