in reply to Using Data Dumper to represent 3 hashes

You don't need to restructure your hashes, you just need to pass separately to Dumper each thing you want listed separately.
my %self; my %abldcache = (test1 => [], test2 => [qw(one two three)]); $self{abldcache} = \%abldcache; use Data::Dumper; sub per_key { my ($name, $href) = @_; my @hkeys = keys %$href; ([@$href{@hkeys}], [map {"$name\{$_}"} @hkeys]) } print Data::Dumper->Dump(per_key('$self{abldcache}', $self{abldcache} +)), "\n"; __END__ # Yields: $self{abldcache}{test1} = []; $self{abldcache}{test2} = [ 'one', 'two', 'three' ];
Close enough?

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^2: Using Data Dumper to represent 3 hashes
by fatherlyons (Initiate) on Feb 15, 2005 at 12:15 UTC

    Cheers,
    Thats exactly what I needed :-)