summaryrefslogtreecommitdiff
path: root/ext/IO
diff options
context:
space:
mode:
Diffstat (limited to 'ext/IO')
-rw-r--r--ext/IO/lib/IO/Socket/INET.pm7
1 files changed, 2 insertions, 5 deletions
diff --git a/ext/IO/lib/IO/Socket/INET.pm b/ext/IO/lib/IO/Socket/INET.pm
index b36a65b951..8f1845b248 100644
--- a/ext/IO/lib/IO/Socket/INET.pm
+++ b/ext/IO/lib/IO/Socket/INET.pm
@@ -41,11 +41,8 @@ sub _sock_info {
$port = $1
if(defined $addr && $addr =~ s,:([\w\(\)/]+)$,,);
- if(defined $proto) {
- if (@proto = ( $proto =~ m,\D,
- ? getprotobyname($proto)
- : getprotobynumber($proto))
- ) {
+ if(defined $proto && $proto =~ /\D/) {
+ if(@proto = getprotobyname($proto) {
$proto = $proto[2] || undef;
}
else {