From: Perl 5 Porters Date: Sun, 17 Mar 1996 11:21:09 +0000 (+0000) Subject: Use Sys::Hostname only when necessary X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4fc7577ba39ac92e91c6838581448a6ba5ddf896;p=p5sagit%2Fp5-mst-13.2.git Use Sys::Hostname only when necessary --- diff --git a/lib/Sys/Syslog.pm b/lib/Sys/Syslog.pm index 32d2e4a..f02a2b5 100644 --- a/lib/Sys/Syslog.pm +++ b/lib/Sys/Syslog.pm @@ -7,7 +7,6 @@ use Carp; @EXPORT = qw(openlog closelog setlogmask syslog); use Socket; -use Sys::Hostname; # adapted from syslog.pl # @@ -200,6 +199,10 @@ sub xlate { } sub connect { + unless ($host) { + require Sys::Hostname; + $host = Sys::Hostname::hostname(); + } my $udp = getprotobyname('udp'); my $syslog = getservbyname('syslog','udp'); my $this = sockaddr_in($syslog, INADDR_ANY);