This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[inseparable changes from match from perl-5.003_96 to perl-5.003_97]
[perl5.git] / lib / syslog.pl
index 2034e0a..9e03399 100644 (file)
@@ -32,14 +32,14 @@ package syslog;
 $host = 'localhost' unless $host;      # set $syslog'host to change
 
 if ($] >= 5) {
-    warn "You should 'use Sys::Socket' instead; continuing" # if $^W
+    warn "You should 'use Sys::Syslog' instead; continuing" # if $^W
 } 
 
 require 'syslog.ph';
 
- eval 'require Socket'                 || 
-eval { require "socket.ph" }   || 
-       require "sys/socket.ph";
+ eval 'use Socket; 1'                  ||
+     eval { require "socket.ph" }      ||
+     require "sys/socket.ph";
 
 $maskpri = &LOG_UPTO(&LOG_DEBUG);
 
@@ -140,10 +140,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 {