Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Check multiple array elements for a single condition

by TheDamian (Vicar)
on Aug 25, 2016 at 12:03 UTC ( [id://1170412]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Smart::Match 'all';
    
    if ( 0 ~~ all(@array[0,1]) ) {
        say 'matched';
    }
    
  2. or download this
    if @array[0 & 1] == 0 {
        say 'matched';
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1170412]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-18 18:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found