in reply to Re: Sort array according to a value in each element?
in thread Sort array according to a value in each element?

jZed, my first thought was "this would be easy if it were SQL".

But the example data is really brain-dead; the real data is interspersed throughout a gigantic text file, and normalizing it for a database isn't really an option.

Update: jZed's reply is right on. I didn't read closely enough. In fact, I didn't realize DBI was capable of treating an arrayref as a database and getting to it via SQL.

I'm knee-deep in the Guttman/Rosler paper at the moment (good information there), but this is definitely worth exploring. Soon.
  • Comment on Re: Re: Sort array according to a value in each element?

Replies are listed 'Best First'.
Re: Re: Re: Sort array according to a value in each element?
by jZed (Prior) on May 24, 2004 at 21:35 UTC
    the real data is interspersed throughout a gigantic text file, and normalizing it for a database isn't really an option.
    I'm sure you're right. But look at my example again. No file or external database is created and no normalizing is done at all. It just takes the same $arrayref you started with and creates a temporary-in-memory table and allows you to query the $arrayfef as if it were a database.