diff options
author | Jarkko Hietaniemi <Jarkko.Hietaniemi@cc.hut.fi> | 1997-04-15 17:21:53 +0300 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-04-15 00:00:00 +1200 |
commit | 6c696f6b7d7a60691ee1a672145eca09129d9019 (patch) | |
tree | a93676e435f9734e8fd8b6fe1f918cc0aed0efcc /lib/Sys/Syslog.pm | |
parent | cf04b53c7ea44c89b75ae0c60c2e66546f15be34 (diff) | |
download | perl-6c696f6b7d7a60691ee1a672145eca09129d9019.tar.gz |
Sys::Syslog: hyphens in hostnames
Jerome Abela writes:
>
> In sub connect of Sys::Syslog, someone wrote:
> ($host) = $host_uniq =~ /(\w+)/;
>
> But, if the name contains a '-', it gets truncated. The RE should
> rather be someting like [a-zA-Z0-9-]+, shouldn't it ?
p5p-msgid: 199704151421.RAA19693@alpha.hut.fi
Diffstat (limited to 'lib/Sys/Syslog.pm')
-rw-r--r-- | lib/Sys/Syslog.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sys/Syslog.pm b/lib/Sys/Syslog.pm index 2da1d769d2..471be11fcd 100644 --- a/lib/Sys/Syslog.pm +++ b/lib/Sys/Syslog.pm @@ -201,7 +201,7 @@ sub connect { unless ($host) { require Sys::Hostname; my($host_uniq) = Sys::Hostname::hostname(); - ($host) = $host_uniq =~ /(\w+)/; + ($host) = $host_uniq =~ /([\w\-]+)/; } my $udp = getprotobyname('udp'); my $syslog = getservbyname('syslog','udp'); |