my $x = 4; my $xx = sub{\@_}->(\$x, \$x); my $y = \4; my $yy = sub{\@_}->($y, $y); bless \$xx->[0], 'Foo'; bless \$xx->[1], 'Bar'; bless \$yy->[0], 'Foo'; bless \$yy->[1], 'Bar'; use Data::XDumper qw(Dump); print "******** Data::XDumper ********\n"; Dump $xx, $yy; print "\n"; use Data::Dumper; print "******** Data::Dumper ********\n"; print Dumper $xx, $yy; print "\n"; use Data::Denter; print "******** Data::Denter ********\n"; print Denter $xx, $yy; print "\n"; # (by merlyn's suggestion in the reply) $Data::Dumper::Purity = 1; print "******** Data::Dumper with purity ********\n"; print Dumper $xx, $yy; print "\n"; # and also use YAML (); print "******** YAML ********\n"; print YAML::Dump $xx, $yy; print "\n";