package syslog;
+use warnings::register;
+
$host = 'localhost' unless $host; # set $syslog'host to change
-if ($] >= 5) {
- warn "You should 'use Sys::Socket' instead; continuing" # if $^W
+if ($] >= 5 && warnings::enabled()) {
+ warnings::warn("You should 'use Sys::Syslog' instead; continuing");
}
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);
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 {