Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: comparing two array

by citromatik (Curate)
on Jun 17, 2009 at 12:21 UTC ( [id://772362]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    print +(grep {$_ eq $elem} @array) ? "Yes" : "No";
    
  2. or download this
    my %h = map { $_ => 1 } @array;
    print defined $h{$elem} ? "Yes" : "No";
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-03-29 05:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found