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

Re: [perl #112538] Feature request - alternate syntax and featuresfor smart matching - [?] {?}

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
April 23, 2012 05:51
Subject:
Re: [perl #112538] Feature request - alternate syntax and featuresfor smart matching - [?] {?}
Message ID:
CAHhgV8i+O=-SFhP6ic8=THj2V82YMnzc7hvt4Tn1tBtPky7mfA@mail.gmail.com
On Mon, Apr 23, 2012 at 2:27 PM, Leon Timmermans <fawaka@gmail.com> wrote:
>> if($array1[?] eq $array2[?]) { ... } # True if @array1 has a common element with @array2
>> if($array[?] eq $arrayref->[?]) { ... } # True if @array has a common element with @$arrayref
>
> @array1 ~~ contains(any($arrayref))

Erm, that should be @array1 ~~ contains(any(@array2))

Leon

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