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

Re: comparsion of 2 arrays

by tphyahoo (Vicar)
on Jun 23, 2005 at 10:02 UTC ( #469340=note: print w/replies, xml ) Need Help??

in reply to comparsion of 2 arrays

You might want to check out String Comparison by Madam, a recent discussion on basically the same theme. In resolving all these types of problems, the best approaches seem to involve morphing from string to array and back with sort/join. You asked a question about arrays, Madam asked a question about strings, but it's the same problem.

This also mentions some issues you need to think about, eg, how do you treat duplicate elements in the list; how do you treat whitespace; etc.

Reasonablekeith's solution, towards the bottom, seemed the best to me. Short and to the point.

You could also have a look at Array::Compare from CPAN, which I fished using a search engine. Good luck.

Replies are listed 'Best First'.
Re^2: comparsion of 2 arrays
by marto (Cardinal) on Jun 23, 2005 at 10:34 UTC
    "You asked a question about arrays, Madam asked a question about strings, but it's the same problem."

    Check out the name of the user who posted this question :)


      Hehhh? Pardons to madam but... well, it is sort of the same problem, isn't it? Well, since my gut told me these issues were linked, I'm going back to that earlier thread and linking back here, at least then everything's tied together for future monks stolpering around here.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2023-03-21 17:06 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (60 votes). Check out past polls.