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

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

Thread Previous | Thread Next
Ed Avis
February 20, 2013 09:49
Re: Salvaging lexical =?utf-8?b?JF8=?= from deprecation
Message ID:
Jesse Luehrs <doy <at>> 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 <>

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About