in reply to treemap
Another thing you might consider is using isa so that the internals of blessed data structures get traversed.
if (UNIVERSAL::isa($node,'HASH')) { ... } [download]