Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
go ahead... be a heretic
 
PerlMonks  

Advice - storing data - which structure do you recommend? (details inside)

by Kratimoyporroon (Novice)
on Mar 17, 2002 at 19:53 UTC ( #152343=perlquestion: print w/ replies, xml ) Need Help??
Kratimoyporroon has asked for the wisdom of the Perl Monks concerning the following question:

Basically, I have a bunch of data I've gathered from an online forum: name, time, post length, and some other random statistics. I want to be able to sort this data by several different fields. Say, first by time and then by name. What data structure do you recommend, and are there any build in methods to sort this stuff? Could you give a brief example? Thanks.

Comment on Advice - storing data - which structure do you recommend? (details inside)
Re: Advice - storing data - which structure do you recommend? (details inside)
by zengargoyle (Deacon) on Mar 17, 2002 at 20:18 UTC
Re: Advice - storing data - which structure do you recommend? (details inside)
by tachyon (Chancellor) on Mar 17, 2002 at 20:40 UTC
Re: Advice - storing data - which structure do you recommend? (details inside)
by cyocum (Curate) on Mar 17, 2002 at 22:43 UTC

    If you want to stay within Perl to do this, you could use the Perl sort function. It allows you to write what is basically an anonymous sub to let you sort anyway you want. Of couse, this puts a constraint on your data structure to an array but if all the attributes are always in the same order then it does not make much difference.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://152343]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2014-04-21 08:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (492 votes), past polls