Skip Menu |

This queue is for tickets about the List-MoreUtils CPAN distribution.

Report information
The Basics
Id: 19512
Status: resolved
Priority: 0/
Queue: List-MoreUtils

People
Owner: Nobody in particular
Requestors: djerius [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.19
Fixed in: (no value)



Subject: XS pairwise doesn't propagate $@
The XS version of pairwise() doesn't propagate $@ if a die occurs in the passed BLOCK. Here's test code: ---------------------------------- #!/usr/bin/perl use strict; use warnings; use List::MoreUtils qw( pairwise ); eval { my @a = ( 1 ); my @b = ( 1 ); pairwise { die("help me!") } @a, @b; }; warn "died: $@" if $@; ------------------------------------ And the results: % env LIST_MOREUTILS_PP=0 perl test % env LIST_MOREUTILS_PP=1 perl test died: help me! at test line 11. %
From: tassilo.von.parseval [...] rwth-aachen.de
Hi there, sorry for being late in responding. For some reason, this report was never forwared to my mail. On Fri May 26 13:53:25 2006, DJERIUS wrote: Show quoted text
> The XS version of pairwise() doesn't propagate $@ if a die occurs in
the Show quoted text
> passed BLOCK. Here's test code: > > ---------------------------------- > #!/usr/bin/perl > > use strict; > use warnings; > > use List::MoreUtils qw( pairwise ); > > eval { > my @a = ( 1 ); > my @b = ( 1 ); > pairwise { die("help me!") } @a, @b; > }; > > warn "died: $@" if $@; > ------------------------------------ > > And the results: > > % env LIST_MOREUTILS_PP=0 perl test > % env LIST_MOREUTILS_PP=1 perl test > died: help me! at test line 11. > %
Indeed, pairwise() uses G_EVAL and doesn't check if the called code died. In fact, right now it does not only not propagate $@, but the die () is effectively tracked. I'll release a fixed version later this week. Cheers, Tassilo