You'll have to be a little bit more specific with your data structures, if you want a more specific answer. However, if you take a look through the Perl FAQ, you will stumble across the following FAQlet that offers various ways of doing what you're trying to do:
How do I test whether two arrays or hashes are equal?
- wil