You want a query language. Two come to mind:
- XPATH. It's used on tree structured data, pretty much as you have here. You'll need to wrap your HoHoHoH as an XML doc to use it.
- SQL. Used on table data, but that might suit you pretty well, you just need to model your data properly (i.e. define a 'Company' as a something which has a 'name' and possibly many 'Application's, possibly many 'People').
Check out the DBD::RAM module if you don't want to mess about with any persistence issues, DBD::SQLite if you don't mind/actually want simple disk storage or MySQL/Postgres if you're that kind of person.
Either way, you'll be defining your underlying types ('Company', 'Application') a little more, which I suspect is the underlying reason you keep running into this issue.
You're make perhaps too much use of the fact that perl doesn't force types down your throat and are hence thinking of everything as a hash rather than an abstract type.
If so, maybe just defining a few struct-type classes will give you places to put your query methods without the need to go to a generalised query language like the above.
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.