#422165 perl-base: IO::Socket::INET reports gethostbyname problems in $@

Package:
perl-base
Source:
perl
Description:
minimal Perl system
Submitter:
Martina Ferrari
Date:
2020-11-15 00:21:09 UTC
Severity:
normal
#422165#5
Date:
2007-05-03 23:47:58 UTC
From:
To:
$ LANG=C perl -MIO::Socket::INET -e 'new
IO::Socket::INET(PeerAddr => "non.existant.host", PeerPort => 25) or die
$!'
Invalid argument at -e line 1.

This is on purpose, as when I read the code, the _error subroutine sets
$! with EINVAL and $@ with the correct error. Which nobody expects (like
the spanish inquisition), nor is documented (save a example in the
manpage that seems like a typo). From the perlvar manpage:

   $@      The Perl syntax error message from the last eval() operator.

So this clearly is a bug.

#422165#14
Date:
2013-12-14 10:29:00 UTC
From:
To:
forwarded 422165 https://rt.perl.org/Public/Bug/Display.html?id=120764
thanks

Just a note that [perl #120764] discusses the same issue.

#422165#21
Date:
2019-10-16 12:18:24 UTC
From:
To:
Nice to meet you i am from Indonesia but husband is from Hanoi and we live
in the U.K , how are you?