On Tue, Jul 3, 2012 at 12:52 PM, Ed Avis <eda@waniasset.com> wrote: > David Mertens asked: > > >Why would "$a in %hash" be equivalent to "exists $hash{$a}"? > > This is how it works in Python, and it seems natural in Perl too. > You could write '$a in values %hash' if you wanted that. > Actually, you couldn't with the previously mentioned syntax. It would be $a in @{[ values %hash ]} Or using the later suggested shortcut, it would be $a in [ values %hash ]Thread Previous | Thread Next