Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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

by bigdogs (Novice)
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 wandering the Monastery: (6)
As of 2014-08-30 13:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls