use Data::Dumper; my $hashref={ ...., k1 => { .... k2 => { .... kN => {...., mydata => MyClass->new(), .... }}}}; print(Dumper($hashref));