http://qs321.pair.com?node_id=522562


in reply to iterators: traversing arbitrary data structure

Look at how Data::Dumper does it. Essentially, you will want to use Scalar::Util's reftype() and go from there.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?