Based on my current understanding of hashes in Perl, I would expect this code to print \"hello world.\" It instead prints nothing.
%a=(); %b=(); $b{str} = \
Hashes of hashes are tricky to get right the first time. In this case
$a{1} = { %b }; ... $a{2} = { %b };
will get you where you want to go.
See perldoc perllol for the gory details about two-dimensional data structures in Perl.