in reply to hashes of hashes
As pointed out by others you don't get anything that is generally very useful when you interpolate a hash reference into a string. However, you can copy hash elements to an array and an array interpolates nicely (for some value of nice):
use strict; use warnings; my %people=( 'Jones'=>{'name'=>'Alison', 'age'=>15, 'pet'=>'dog',}, 'Smith'=>{'name'=>'Tom', 'age'=>34, 'pet'=>'cat',} ); for (keys %people) { my @values = %{$people{$_}}; print "@values\n"; }
Prints:
pet cat name Tom age 34 pet dog name Alison age 15
|
|---|