Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: seeking in hash data structure

by Corion (Patriarch)
on Oct 25, 2006 at 08:58 UTC ( [id://580513]=note: print w/replies, xml ) Need Help??


in reply to Re: seeking in hash data structure
in thread seeking in hash data structure

There is Class::XPath, which allows you to graft XPath queries onto almost any class structure. Also, there is Data::Diver, which has its own query "language" to access elements without autovivification. Using a database incurs a lot of front-up work which may or may not pay off in the long run, as for every addition to the data format, the SQL schema needs to be modified. LDAP seems more suited for storing unstructured or semistructured hierarchical data.

Replies are listed 'Best First'.
Re^3: seeking in hash data structure
by jbert (Priest) on Oct 25, 2006 at 10:05 UTC
    Ah, I didn't know about Class::XPath. Looks very nice, and almost exactly what the doctor ordered.

    As far as I can see, Data::Diver doesn't allow the more general kind of querying which the OP requested.

    And whilst LDAP has a special place in my heart, as far as I know, it has the same schema issues which SQL does. LDAP object classes need to be defined in terms of mandatory and optional attributes, the attributes need to have an appropriate syntax. Basically LDAP object class == SQL table, LDAP attribute == SQL column. The main differences IMHO are that LDAP gives you a heirarchically-defined name for each entry and SQL gives you a richer query language.

    I would agree that DBs aren't the answer to everything, but they are an answer to "how do I do fairly arbitrary queries to my structuted data".

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-18 05:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found