Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
It is known that 'key' ~~ \%hash returns true if 'key' exists in %hash.use 5.010; my %hash = (a => 1); given(\%hash){ # first true #given('a'){ # all true when('a' ~~ $_){ say "explicit ~~"; continue; } when($_ ~~ 'a'){ say "reversed explicit ~~"; continue; } when('a'){ say "implicit ~~"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Wrong behavior of the implicit smart operator in the given/when blocks
by ikegami (Patriarch) on Apr 30, 2012 at 15:42 UTC | |
|
Re: Wrong behavior of the implicit smart operator in the given/when blocks
by educated_foo (Vicar) on Apr 30, 2012 at 15:35 UTC | |
by ikegami (Patriarch) on Apr 30, 2012 at 15:45 UTC | |
by tobyink (Canon) on Apr 30, 2012 at 16:40 UTC |