Skip Menu |

This queue is for tickets about the IO-Async CPAN distribution.

Report information
The Basics
Id: 87051
Status: resolved
Priority: 0/
Queue: IO-Async

People
Owner: Nobody in particular
Requestors: rurban [...] x-ray.at
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.59



Subject: [PATCH] return or precedence
return or die will skip the die. see https://rt.perl.org/rt3/Public/Bug/Display.html?id=59802 See attached patch
Subject: IO-Async-0.58-returnor.patch
diff -bu ./lib/IO/Async/Resolver.pm~ ./lib/IO/Async/Resolver.pm --- ./lib/IO/Async/Resolver.pm~ 2013-06-12 19:04:03.000000000 -0500 +++ ./lib/IO/Async/Resolver.pm 2013-07-19 09:48:41.213315028 -0500 @@ -516,23 +516,23 @@ # Now register the inbuilt methods -register_resolver getpwnam => sub { return getpwnam( $_[0] ) or die "$!\n" }; -register_resolver getpwuid => sub { return getpwuid( $_[0] ) or die "$!\n" }; +register_resolver getpwnam => sub { return getpwnam( $_[0] ) || die "$!\n" }; +register_resolver getpwuid => sub { return getpwuid( $_[0] ) || die "$!\n" }; -register_resolver getgrnam => sub { return getgrnam( $_[0] ) or die "$!\n" }; -register_resolver getgrgid => sub { return getgrgid( $_[0] ) or die "$!\n" }; +register_resolver getgrnam => sub { return getgrnam( $_[0] ) || die "$!\n" }; +register_resolver getgrgid => sub { return getgrgid( $_[0] ) || die "$!\n" }; -register_resolver getservbyname => sub { return getservbyname( $_[0], $_[1] ) or die "$!\n" }; -register_resolver getservbyport => sub { return getservbyport( $_[0], $_[1] ) or die "$!\n" }; +register_resolver getservbyname => sub { return getservbyname( $_[0], $_[1] ) || die "$!\n" }; +register_resolver getservbyport => sub { return getservbyport( $_[0], $_[1] ) || die "$!\n" }; -register_resolver gethostbyname => sub { return gethostbyname( $_[0] ) or die "$!\n" }; -register_resolver gethostbyaddr => sub { return gethostbyaddr( $_[0], $_[1] ) or die "$!\n" }; +register_resolver gethostbyname => sub { return gethostbyname( $_[0] ) || die "$!\n" }; +register_resolver gethostbyaddr => sub { return gethostbyaddr( $_[0], $_[1] ) || die "$!\n" }; -register_resolver getnetbyname => sub { return getnetbyname( $_[0] ) or die "$!\n" }; -register_resolver getnetbyaddr => sub { return getnetbyaddr( $_[0], $_[1] ) or die "$!\n" }; +register_resolver getnetbyname => sub { return getnetbyname( $_[0] ) || die "$!\n" }; +register_resolver getnetbyaddr => sub { return getnetbyaddr( $_[0], $_[1] ) || die "$!\n" }; -register_resolver getprotobyname => sub { return getprotobyname( $_[0] ) or die "$!\n" }; -register_resolver getprotobynumber => sub { return getprotobynumber( $_[0] ) or die "$!\n" }; +register_resolver getprotobyname => sub { return getprotobyname( $_[0] ) || die "$!\n" }; +register_resolver getprotobynumber => sub { return getprotobynumber( $_[0] ) || die "$!\n" }; =pod
On Fri Jul 19 10:49:40 2013, rurban@x-ray.at wrote: Show quoted text
> return or die will skip the die. see > https://rt.perl.org/rt3/Public/Bug/Display.html?id=59802 > > See attached patch
Ah yes, good catch. Turns out that fix is insufficient because it still needs list-return. But I've found a solution. Thanks. -- Paul Evans
Was released in 0.59 -- Paul Evans