Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Compare all array values without a loop

by rjbs (Pilgrim)
on Oct 19, 2004 at 14:22 UTC ( #400537=note: print w/replies, xml ) Need Help??


in reply to Compare all array values without a loop

if (grep({ $_ eq $foobar } @array) == @array) { ... }
"If the number of elements equal to $foobar is the same as the number of elements in the array..." or
unless (grep { $_ ne $foobar} @array) { ... }
"Unless you find an element that is not equal to foobar..."

Of course, these are both loops of a kind.
rjbs

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://400537]
help
Chatterbox?
[Eily]: somehow when googling pärskäys I got a pageful of Finnish :P
[robby_dobby]: Can I go participate in an YAPC?
[Eily]: (I was trying to find a translation but google translate didn't help)
robby_dobby is not entirely serious
[LanX]: ... thank God France doesn't have an electoral college...
[Eily]: LanX, let's hope it gets better for the second turn
vrk adds oatmeal cookies to the platter on the sideboard.
[LanX]: evrybody can participate in a YAPC
choroba is still undecided what to present at YAPC
[LanX]: imagine the stock market if the choice for the second round would have been those two ...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2017-04-24 15:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (442 votes). Check out past polls.