From 4fc7577ba39ac92e91c6838581448a6ba5ddf896 Mon Sep 17 00:00:00 2001 From: Perl 5 Porters Date: Sun, 17 Mar 1996 11:21:09 +0000 Subject: Use Sys::Hostname only when necessary --- lib/Sys/Syslog.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/Sys') diff --git a/lib/Sys/Syslog.pm b/lib/Sys/Syslog.pm index 32d2e4ad0d..f02a2b516c 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); -- cgit v1.2.1