Perl's lack of 'in' keyword

Andy Armstrong andy at hexten.net
Tue Oct 7 16:11:23 BST 2008


On 7 Oct 2008, at 16:04, Paul Makepeace wrote:

> ... is starting to frustrate me. It's the one feature I am finding I'm
> really missing from That Other Language.
>
>  if ($bar in @foo) {
>    # ...
>  }

Smart match innit?

use 5.010;
if ( $bar ~~ @foo ) {
   # ...
}

-- 
Andy Armstrong, Hexten





More information about the london.pm mailing list