Skip Menu |

This queue is for tickets about the Hook-LexWrap CPAN distribution.

Report information
The Basics
Id: 99021
Status: resolved
Priority: 0/
Queue: Hook-LexWrap

People
Owner: Nobody in particular
Requestors: jkeenan [...] cpan.org
Cc: ether [...] cpan.org
KENTNL [...] cpan.org
AdminCc:

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



CC: ether [...] cpan.org
Subject: Perl 5 blead breaks Hook::LexWrap::wrap()
When tested against Perl 5 blead, Hook-LexWrap has begun to break. For details, see: https://rt.perl.org/Ticket/Display.html?id=122757
Here is a patch. As for why this change in bleadperl was made, see <http://perl5.git.perl.org/perl.git/commitdiff/cfc7ef1544e>.
Subject: open_5U5ibUNE.txt
diff -rup Hook-LexWrap-0.24-IVpg0D-orig/lib/Hook/LexWrap.pm Hook-LexWrap-0.24-IVpg0D/lib/Hook/LexWrap.pm --- Hook-LexWrap-0.24-IVpg0D-orig/lib/Hook/LexWrap.pm 2010-09-23 21:40:08.000000000 -0700 +++ Hook-LexWrap-0.24-IVpg0D/lib/Hook/LexWrap.pm 2014-09-21 12:23:33.000000000 -0700 @@ -114,11 +114,11 @@ This document describes version 0.23 of sub doit { print "[doit:", caller, "]"; return {my=>"data"} } SCOPED: { - wrap doit, + wrap doit => pre => sub { print "[pre1: @_]\n" }, post => sub { print "[post1:@_]\n"; $_[1]=9; }; - my $temporarily = wrap doit, + my $temporarily = wrap doit => post => sub { print "[post2:@_]\n" }, pre => sub { print "[pre2: @_]\n "}; @@ -205,7 +205,7 @@ Access to the arguments and return value techniques such as memoization: my %cache; - wrap fibonacci, + wrap fibonacci => pre => sub { $_[-1] = $cache{$_[0]} if $cache{$_[0]} }, post => sub { $cache{$_[0]} = $_[-1] }; @@ -214,7 +214,7 @@ or for converting arguments and return v # set_temp expects and returns degrees Fahrenheit, # but we want to use Celsius - wrap set_temp, + wrap set_temp => pre => sub { splice @_, 0, 1, $_[0] * 1.8 + 32 }, post => sub { $_[-1] = ($_[0] - 32) / 1.8 }; diff -rup Hook-LexWrap-0.24-IVpg0D-orig/t/example1.t Hook-LexWrap-0.24-IVpg0D/t/example1.t --- Hook-LexWrap-0.24-IVpg0D-orig/t/example1.t 2010-09-23 21:41:19.000000000 -0700 +++ Hook-LexWrap-0.24-IVpg0D/t/example1.t 2014-09-21 12:12:39.000000000 -0700 @@ -9,11 +9,11 @@ sub doit { $str.= "[doit:{".join(',',cal SCOPED: { no warnings 'uninitialized'; #last argument in wrapper sub - wrap doit, + wrap doit => pre => sub { $str.="[pre1: @_]" }, post => sub { $str.="[post1:@_]"; $_[1]=9; }; - my $temporarily = wrap doit, + my $temporarily = wrap doit => post => sub { $str.="[post2:@_]" }, pre => sub { $str.="[pre2: @_]"}; diff -rup Hook-LexWrap-0.24-IVpg0D-orig/t/test.t Hook-LexWrap-0.24-IVpg0D/t/test.t --- Hook-LexWrap-0.24-IVpg0D-orig/t/test.t 2009-09-15 17:22:02.000000000 -0700 +++ Hook-LexWrap-0.24-IVpg0D/t/test.t 2014-09-21 12:14:58.000000000 -0700 @@ -10,11 +10,11 @@ sub actual { ok $_[0]; } actual 1; { - my $lexical = wrap actual, + my $lexical = wrap actual => pre => sub { ok 2 }, post => sub { ok 4 }; - wrap actual, pre => sub { $_[0]++ }; + wrap actual => pre => sub { $_[0]++ }; my $x = 2; actual $x; @@ -26,12 +26,12 @@ wrap *main::actual, post => sub { ok 6 } actual my $x = 4; no warnings qw/bareword reserved/; -eval { wrap other, pre => sub { print "not ok 7\n" } } or ok 7; +eval { wrap other => pre => sub { print "not ok 7\n" } } or ok 7; -eval { wrap actual, pre => 1 } and print "not "; +eval { wrap actual => pre => 1 } and print "not "; ok 8; -eval { wrap actual, post => [] } and print "not "; +eval { wrap actual => post => [] } and print "not "; ok 9; BEGIN { *{CORE::GLOBAL::sqrt} = sub { CORE::sqrt(shift) } } @@ -60,7 +60,7 @@ sub wrapped_callee { return join '|', caller; } -wrap wrapped_callee, +wrap wrapped_callee => pre =>sub{ print "not " unless $_[0] eq join '|', caller; ok 17 @@ -77,11 +77,11 @@ sub raw_callee { print "not " unless wrapped_callee(scalar raw_callee); ok 19; sub scalar_return { return 'string' } -wrap scalar_return, post => sub { $_[-1] .= 'ent' }; +wrap scalar_return => post => sub { $_[-1] .= 'ent' }; print "not " unless scalar_return eq 'stringent'; ok 20; sub list_return { return (0..9) } -wrap list_return, post => sub { @{$_[-1]} = reverse @{$_[-1]} }; +wrap list_return => post => sub { @{$_[-1]} = reverse @{$_[-1]} }; my @result = list_return; for (0..9) { print "not " and last unless $_ + $result[$_] == 9; @@ -89,46 +89,46 @@ for (0..9) { ok 21; sub shorted_scalar { return 2 }; -wrap shorted_scalar, pre => sub { $_[-1] = 1 }; +wrap shorted_scalar => pre => sub { $_[-1] = 1 }; fail { shorted_scalar != 1 }; ok 22; sub shorted_list { return (2..9) }; { - my $lexical = wrap shorted_list, pre => sub { $_[-1] = [1..9] }; + my $lexical = wrap shorted_list => pre => sub { $_[-1] = [1..9] }; fail { (shorted_list)[0] != 1 }; ok 23; } { - my $lexical = wrap shorted_list, pre => sub { $_[-1] = 1 }; + my $lexical = wrap shorted_list => pre => sub { $_[-1] = 1 }; fail { (shorted_list)[0] != 1 }; ok 24; } { - my $lexical = wrap shorted_list, pre => sub { @{$_[-1]} = (1..9) }; + my $lexical = wrap shorted_list=>pre => sub { @{$_[-1]} = (1..9) }; fail { (shorted_list)[0] != 1 }; ok 25; } { - my $lexical = wrap shorted_list, pre => sub { @{$_[-1]} = [1..9] }; + my $lexical = wrap shorted_list=>pre => sub { @{$_[-1]} = [1..9] }; fail { (shorted_list)[0]->[0] != 1 }; ok 26; } { - my $lexical = wrap shorted_list, post => sub { $_[-1] = [1..9] }; + my $lexical = wrap shorted_list=> post => sub { $_[-1] = [1..9] }; fail { (shorted_list)[0] != 1 }; ok 27; } { - my $lexical = wrap shorted_list, post => sub { $_[-1] = 1 }; + my $lexical = wrap shorted_list => post => sub { $_[-1] = 1 }; fail { (shorted_list)[0] != 1 }; ok 28; } { - my $lexical = wrap shorted_list, post => sub { @{$_[-1]} = (1..9) }; + my $lexical = wrap shorted_list=>post => sub { @{$_[-1]} = (1..9) }; fail { (shorted_list)[0] != 1 }; ok 29; } { - my $lexical = wrap shorted_list, post => sub { @{$_[-1]} = [1..9] }; + my $lexical = wrap shorted_list=>post => sub { @{$_[-1]} = [1..9] }; fail { (shorted_list)[0]->[0] != 1 }; ok 30; } sub howmany { ok 32 if @_ == 3 } -wrap howmany, +wrap howmany => pre => sub { ok 31 if @_ == 4 }, post => sub { ok 33 if @_ == 4 }; @@ -143,7 +143,7 @@ sub wanted { ok $_[1] } -wrap wanted, +wrap wanted => pre => sub { my $expected = $_[3]; print 'not ' unless defined wantarray == defined $expected @@ -185,15 +185,15 @@ sub inner { wrapped(@_) } outer(43..48); -wrap wrapped, +wrap wrapped => pre => sub {}, post => sub {}; -wrap wrapped, +wrap wrapped => pre => sub {}, post => sub {}; -wrap wrapped, +wrap wrapped => pre => sub {}, post => sub {};
Patch Works For Me,
Perl 5.21.5 is now out, making two dev releases where this module is uninstallable -- would it be possible for this to be released soon, please? Alternatively, would it be possible to add additional maintainers for this distribution?
Subject: Re: [rt.cpan.org #99021] Perl 5 blead breaks Hook::LexWrap::wrap()
Date: Tue, 21 Oct 2014 09:36:45 +1100
To: bug-Hook-LexWrap [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Show quoted text
> Alternatively, would it be possible to add additional maintainers for this distribution?
I'd be happy to add someone as co-maintainer. Just let me know the appropriate CPAN ID. Damian
Subject: Re: [rt.cpan.org #99021] Perl 5 blead breaks Hook::LexWrap::wrap()
Date: Mon, 20 Oct 2014 16:06:15 -0700
To: "damian [...] conway.org via RT" <bug-Hook-LexWrap [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Mon, Oct 20, 2014 at 06:37:36PM -0400, damian@conway.org via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=99021 > >
> > Alternatively, would it be possible to add additional maintainers for this distribution?
> > I'd be happy to add someone as co-maintainer. > Just let me know the appropriate CPAN ID.
ETHER. I can ship the patch tonight.
Subject: Re: [rt.cpan.org #99021] Perl 5 blead breaks Hook::LexWrap::wrap()
Date: Tue, 21 Oct 2014 11:08:01 +1100
To: bug-hook-lexwrap <bug-Hook-LexWrap [...] rt.cpan.org>
From: Damian Conway <damian [...] conway.org>
Show quoted text
> Change Permissions > Added ETHER to co-maintainers of Hook::LexWrap. > Added ETHER to co-maintainers of Hook::LexWrap::Cleanup.
Thank-you for offering to help, Karen. Damian
RT-Send-CC: damian [...] conway.org
Thank you very much; 0.25 will be released tonight!