p "@_" ARRAY(0x38234) Big::Nested::Mess=HASH(0x382437) x keys %{ $_[1] } ...just the keys, so you can see what to look for... #### sub p { my $x = shift; if (! ref $x) { return $x; } elsif (ref($x) eq 'My::Class') { return bless { name => $x->{name}, manager => $x->{manager}->getId(), children => p($x->{children}), # add any other fields you want to see }, ref($x); } elsif (UNIVERSAL::isa($x, 'ARRAY')) { return [ map { p($_) } @$x ]; } elsif (UNIVERSAL::isa($x, 'HASH')) { return { map { $_ => p($x->{$_}) } keys %$x }; } else { return $x; } }