develooper Front page | perl.perl5.porters | Postings from July 2009

Re: [perl #67694] List::Util attaching to the wrong $_ when used inside given/when construct

Thread Previous | Thread Next
From:
Yitzchak Scott-Thoennes
Date:
July 24, 2009 20:06
Subject:
Re: [perl #67694] List::Util attaching to the wrong $_ when used inside given/when construct
Message ID:
54276.97.113.85.112.1248491156.squirrel@webmail.efn.org
On Fri, July 24, 2009 5:28 pm, Yitzchak Scott-Thoennes wrote:
> On Fri, July 24, 2009 3:44 pm, Eric Brine wrote:
>> On Fri, Jul 24, 2009 at 4:42 PM, Rafael Garcia-Suarez wrote:
>>> Yes, although I'm not 100% sure that pp_given does exactly the right
>>> thing with the pad. List::Util::first needs to assign to the lexical
>>> $_ in the pad if there is one.
>>
>> How are the Pure Perl implementation of List::Util and countless other
>> Perl (&) subs suppose to do that?
>
> Add a reference to the proper $_ to the caller() return list?

Err, never mind, that wouldn't tell you what $_ was in scope of the sub if
the sub wasn't in the caller's scope.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About