Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Creating SELECT-like look-up tables as hashes

by bigdogs (Acolyte)
on Dec 01, 2013 at 16:53 UTC ( #1065157=note: print w/ replies, xml ) Need Help??


in reply to Creating SELECT-like look-up tables as hashes

In this case, the %lookup_id hash is unnecessary: you never have to find a row by id, but just to scan them all.

A simple foreach is enough:

foreach my $ref (@rows) { push @{ $lookup_fur_and_legs{$ref->{id}} }, $ref; }


Comment on Re: Creating SELECT-like look-up tables as hashes
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2015-07-08 02:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls