in reply to A better way for walking through HoHoH ?

A three level structure you want to walk on all levels. Three simple loops; I don't think it gets any better than that.

But then, who knows? What's *your* notion of "better"?

  • Comment on Re: A better way for walking through HoHoH ?

Replies are listed 'Best First'.
Re^2: A better way for walking through HoHoH ?
by ZlR (Chaplain) on Mar 24, 2010 at 13:32 UTC
    Actually i was wondering if i could do without using a hash ^^
    I've been doing this hash trick for a long time now, but i could use a flat db file then do sql request to get what i want from it. It's a long shot tho given my below average sql skills !
      Actually i was wondering if i could do without using a hash
      Uhm, so, you have a hash of hashes of hashes, and your idea of a "better" way of walking through them is to not use hashes?

      Why? I guess you could use a serializer to turn your datastructure into a big string, and use regular expressions or index/substr to parse it, but I fail to see why you'd qualify that as "better".

      If you ever want to play around with this approach, there is a flat DB that works with CSV files. You will need:
      DBI
      SQL::Statement
      Text::CSV_XS
      DBD::CSV

      This is fine for small, simple DB. Its of course slower than the "real thing" and doesn't have fancy features, but I've used it before with good results. Since the DB is a CSV file you can look at it in Excel or whatever. And since it uses standard SQL statements, you can migrate to a different DB later if needed.