integrate cfgperl contents into mainline
[p5sagit/p5-mst-13.2.git] / lib / syslog.pl
index 8807ef0..70c439b 100644 (file)
 
 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 {