summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/IO/lib/IO/Socket/INET.pm3
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/IO/lib/IO/Socket/INET.pm b/ext/IO/lib/IO/Socket/INET.pm
index 7083b99fc5..051de539cf 100644
--- a/ext/IO/lib/IO/Socket/INET.pm
+++ b/ext/IO/lib/IO/Socket/INET.pm
@@ -52,8 +52,7 @@ sub _sock_info {
}
if(defined $port) {
-
- my $defport = ($port =~ s,\((\d+)\)$,,)[0];
+ my $defport = ($port =~ s,\((\d+)\)$,,) ? $1 : undef;
my $pnum = ($port =~ m,^(\d+)$,)[0];
@serv = getservbyname($port, $proto[0] || "")