develooper Front page | perl.perl5.porters | Postings from February 2013

Re: Salvaging lexical =?utf-8?b?JF8=?= from deprecation

Thread Previous | Thread Next
From:
Ed Avis
Date:
February 20, 2013 09:49
Subject:
Re: Salvaging lexical =?utf-8?b?JF8=?= from deprecation
Message ID:
loom.20130220T104055-85@post.gmane.org
Jesse Luehrs <doy <at> tozt.net> writes:

>$_ is basically useless except for the global form.

>"my $_ = 'foo'; my @bar = any { $_ eq 'a' } qw(a b c)"

Might it be better for higher-order functions like map, any, and sort to pass
the argument as an argument, rather than in $_?  Unfortunately there is a lot
of existing code that relies on global $_ as you point out.

-- 
Ed Avis <eda@waniasset.com>


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