in reply to treemap

Very nice. I love it when I someone else has done the thinking for me.

Another thing you might consider is using isa so that the internals of blessed data structures get traversed.

if (UNIVERSAL::isa($node,'HASH')) { ... }