in reply to How to define and deref hash of hash of hash

I think it's interesting that with the correction of one syntactic problem (semicolon statement terminators within the list definition), the OPed code actually works... sorta. At least, it can be made to compile. The data structure desired by dirtdog is absent at the highest level, but at least the structure at lower levels is captured for possible future use.

c:\@Work\Perl\monks>perl -wMstrict -MData::Dump -le "my %Businesses = ( my %teams = ( NFL => { 'JETS' => 1, 'PATRIOTS' => 1, 'GIANTS' => 1 }, MLB => { 'YANKEES' => 1, 'METS' => 1, 'CARDINALS' => 1 }, ), my %restaurants = ( FASTFOOD => { 'WENDYS' => 1, 'MCDONALDS' => 1, }, FINEDINING => { 'GRILL 23' => 1, 'CAPITAL GRILL' => 1, }, ), ); dd \%Businesses; dd \%teams; dd \%restaurants; " { FASTFOOD => { MCDONALDS => 1, WENDYS => 1 }, FINEDINING => { "CAPITAL GRILL" => 1, "GRILL 23" => 1 }, MLB => { CARDINALS => 1, METS => 1, YANKEES => 1 }, NFL => { GIANTS => 1, JETS => 1, PATRIOTS => 1 }, } { MLB => { CARDINALS => 1, METS => 1, YANKEES => 1 }, NFL => { GIANTS => 1, JETS => 1, PATRIOTS => 1 }, } { FASTFOOD => { MCDONALDS => 1, WENDYS => 1 }, FINEDINING => { "CAPITAL GRILL" => 1, "GRILL 23" => 1 }, }

What would you need to do to make this appproach work more or less as originally intended? One way:

c:\@Work\Perl\monks>perl -wMstrict -MData::Dump -le "my %Businesses = ( teams => my $teams = { NFL => { 'JETS' => 1, 'PATRIOTS' => 1, 'GIANTS' => 1 }, MLB => { 'YANKEES' => 1, 'METS' => 1, 'CARDINALS' => 1 }, }, restaurants => my $restaurants = { FASTFOOD => { 'WENDYS' => 1, 'MCDONALDS' => 1, }, FINEDINING => { 'GRILL 23' => 1, 'CAPITAL GRILL' => 1, }, }, ); dd \%Businesses; dd $teams; dd $restaurants; " { restaurants => { FASTFOOD => { MCDONALDS => 1, WENDYS => 1 }, FINEDINING => { "CAPITAL GRILL" => 1, "GRILL 23" => 1 }, }, teams => { MLB => { CARDINALS => 1, METS => 1, YANKEES => 1 }, NFL => { GIANTS => 1, JETS => 1, PATRIOTS => 1 }, }, } { MLB => { CARDINALS => 1, METS => 1, YANKEES => 1 }, NFL => { GIANTS => 1, JETS => 1, PATRIOTS => 1 }, } { FASTFOOD => { MCDONALDS => 1, WENDYS => 1 }, FINEDINING => { "CAPITAL GRILL" => 1, "GRILL 23" => 1 }, }

I know not of what possible use is this revelation.


Give a man a fish:  <%-{-{-{-<