Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by derby (Abbot)
on Aug 07, 2013 at 17:51 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-20 00:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found