On Sat Dec 10 09:55:36 2011, fany@cpan.org wrote: > > This is a bug report for perl from fany@cpan.org, > generated with the help of perlbug 1.39 running under perl 5.14.2. > > > ----------------------------------------------------------------- > [Please describe your issue here] > > > When I use a function which expects a codeblock as first > argument, like List::Util::first(), within a "given" block, > then $_ within that codeblock does not work properly, but > keeps the value of the $_ from the "given" block. > > Or, in other words, the test script below will output the > following: > > 1 - 2 - 3 - grep OK! > 1 - first OK! > 1 - fpp OK! > 1 - 2 - 3 - grep within given OK! > 0 - 0 - 0 - > 0 - 0 - 0 - > > Kind regards, > fany This is a known issue, #67694. given does an implicit ‘my $_’. See also ticket #90018 and ticket #53186 (marked as resolved, even though it isn’t). RJBS: Would you be adverse to changing ‘given’ to alias $_ properly, or is it too close to 5.16 at this stage? -- Father ChrysostomosThread Previous | Thread Next