in reply to Using Data Dumper to represent 3 hashes
Close enough?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' ];
|
|---|
| 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 |