Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2017-07-26 01:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (383 votes). Check out past polls.