Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: grepping the location of a value from a datastructure

by derby (Abbot)
on Aug 07, 2013 at 17:51 UTC ( #1048397=note: print w/replies, xml ) Need Help??


in reply to Re^2: grepping the location of a value from a datastructure
in thread grepping the location of a value from a datastructure

Then you should probably invert your data structure. Instead of

my $hash = { base => { key => 'value', key2 => 'value2'}};

consider

my $hash = { "value" => [ { 'chapter' => 2, 'paragraph' => 10 }, { 'chapter' => 2, 'paragraph' => 11 }, ... ], "value2" => [ { 'chapter' => 3, 'paragraph' => 1 } ] };
-derby

Replies are listed 'Best First'.
Re^4: grepping the location of a value from a datastructure
by rastoboy (Monk) on Aug 07, 2013 at 18:57 UTC
    You are a f*cking genius. LMAO.

    Of course, that would work perfectly!

    Thanks! I'd still be interested if anyone has other clever ideas though, in principle.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2022-05-16 10:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (62 votes). Check out past polls.

    Notices?