X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fsyslog.pl;h=9e03399e4df608371ccf957a03fbae2ecbea9afc;hb=6b8afdafd43a19a5a652c59255c9895c9bcbe27b;hp=2034e0aa4862dc512623856ec786cbc4bb10adae;hpb=cb1a09d0194fed9b905df7b04a4bc031d354609d;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/syslog.pl b/lib/syslog.pl index 2034e0a..9e03399 100644 --- a/lib/syslog.pl +++ b/lib/syslog.pl @@ -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 {