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

Re: Smartmatch two cents (was... List::Util... when...)

Thread Previous | Thread Next
From:
Abigail
Date:
July 10, 2012 04:16
Subject:
Re: Smartmatch two cents (was... List::Util... when...)
Message ID:
20120710111815.GC13952@almanda
On Tue, Jul 03, 2012 at 01:58:45PM -0400, Eric Brine wrote:
> On Tue, Jul 3, 2012 at 4:59 AM, Ed Avis <eda@waniasset.com> wrote:
> 
> > As in Python, 'in' could work for both arrays and hashes:
> >
> >    $x in @array
> >
> >    $x in %hash    # same as exists $hash{$x}
> >
> 
> So C<< $x in @array >> checks the values, and C<< $x in %hash >> checks the
> keys? Isn't that confusing?


Not for me. 



Abigail

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