Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: comparsion of 2 arrays

by blazar (Canon)
on Jun 23, 2005 at 09:52 UTC ( #469337=note: print w/replies, xml ) Need Help??


in reply to comparsion of 2 arrays

You may sort and then check if "@arr1" eq "@arr2", which is not bullet-proof, but could be suitable for your needs, especially if you set $" accordingly. This still involves more than one statement, well, unless you like a horrible hack like
"@{[sort @arr1]}" eq "@{[sort @arr2]}";
Otherwise, whatever method you really use behind the scenes, who prevents you from wrapping it in a Compare() sub?

Log In?
Username:
Password:

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

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






    Results (60 votes). Check out past polls.

    Notices?