Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: compare two arrays

by nagalenoj (Friar)
on Dec 15, 2008 at 09:28 UTC ( #730378=note: print w/replies, xml ) Need Help??


in reply to compare two arrays

Dear monk,

We can also do like the below,

my @a=(1,2,4,5,3); my @b=(1,2,4,2,3); my @c = map { $a[$_] <=> $b[$_] ? 0 : 1 } 0 .. $#a; print @c;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://730378]
help
Chatterbox?
and cookies bake in the oven...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2017-11-23 15:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (336 votes). Check out past polls.

    Notices?