in reply to Sorting hashes...
One alternative would be using The Perl Data Language (PDL). You could have a look at the online book and the installation instructions to have an idea of how long it would take for you to start using PDL. If you decided to go with PDL, you could use the following approach:
- Create three piddles (piddles are the name for the data structures that hold matrices in PDL). One to hold the string Box Name (this one has to be of Char piddle type so you need to add use PDL::Char). The second one to hold the MinX, MinY, MaxX, MaxY values. The last one to hold the Areas
- Sort the piddle of Areas using qsorti to have access to the indices of elements in ascending order. In this way, you could use the indices to sort all the piddles.
- To determine if two boxes overlap, you could create two piddles of the size of the larger box (using zeroes, for example) and then put special values (you could use "ones" or any other value you wish) in the elements that are between the respective [MinX, MaxX] and [MinY, MaxY]. For this you would need to use which and index. Finally, you find the intersection between the two piddles using intersect. If the intersection is not empty then the two piddles overlap.
By the way, I recommend you to have a look at RFC: Getting Started with PDL (the Perl Data Language) to see how those functions work.
Good luck with your project.