Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2016-07-26 19:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (239 votes). Check out past polls.