Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Fast seeking in a large array of hashes to generate a report.

by Zaxo (Archbishop)
on Jun 23, 2005 at 07:29 UTC ( #469309=note: print w/ replies, xml ) Need Help??


in reply to Fast seeking in a large array of hashes to generate a report.

Your splice is one obvious inefficiency. You could push onto another array or grep. The resulting array of indexes could be used in a slice of @Persons.

Where is @Persons populated from? If a file, you could do your filtering as you read it. If a database, you can make it do all the work.

To make executable filters from form data, be cautious. You'll be tempted to eval, but that is inviting trouble. Try setting up a dispatch table (a hash of code references) of functions to call via the field names, with field name and value as arguments. Where you have several fields, grep is again your friend.

After Compline,
Zaxo


Comment on Re: Fast seeking in a large array of hashes to generate a report.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (18)
As of 2014-07-31 12:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (248 votes), past polls