On Thu, Mar 17, 2005 at 02:21:09AM -0700, Luke Palmer wrote:
> In particular, the fact that `map` rebinds $_.  Consider:
> 
>     method data () {
>         map { .process($_) } @.array;
>     }
> 
> Is that calling `$_.process($_)` for each `$_` in [EMAIL PROTECTED], or is it
> calling `$self.process($_)`?  It must be the former, which, given the
> context, is probably not what was intended (despite the terrible (but
> unfortunately, typical) naming, we can still tell what the programmer
> was thinking).  `.process` means something else everywhere else in the
> method, and Perl goes to great lengths to keep it that way, but in this
> case it's different.  
> 
> And it would be a shame to disallow the use of $_ in map.

Err, wait, I don't think we are discussing whether $_ is to be outlawed
in map {}. I think the proposal is for .method always mean $invocant.method
and make it illegal when there is no invocants in sight, mush as $.attr
would be illegal without an invocant.  To use $_.foo, write $_.foo.

Thanks,
/Autrijus/

Attachment: pgpKXy22SbNnP.pgp
Description: PGP signature

Reply via email to