use Tk; use Data::Dumper; $hash{'KEY'}="VALUE"; $hash{'SUBKEY1'}{'KEY1'}="VALUE"; $hash{'SUBKEY1'}{'KEY2'}="VALUE"; $hash{'SUBKEY1'}{'KEY3'}="VALUE"; $hash{'SUBKEY1'}{'KEY4'}="VALUE"; $hash{'SUBKEY1'}{'SUBSUBKEY1'}{'KEY1'}="VALUE"; $hash{'SUBKEY1'}{'SUBSUBKEY1'}{'KEY2'}="VALUE"; $hash{'SUBKEY1'}{'SUBSUBKEY1'}{'KEY3'}="VALUE"; $hash{'SUBKEY1'}{'SUBSUBKEY1'}{'KEY4'}="VALUE"; $hash{'SUBKEY1'}{'SUBSUBKEY2'}{'KEY4'}="VALUE"; $hash{'SUBKEY1'}{'SUBSUBKEY3'}{'KEY4'}="VALUE"; $hash{'SUBKEY1'}{'SUBSUBKEY4'}{'KEY4'}="VALUE"; $hash{'SUBKEY2'}{'KEY1'}="VALUE"; $hash{'SUBKEY2'}{'KEY2'}="VALUE"; $hash{'SUBKEY2'}{'KEY3'}="VALUE"; $hash{'SUBKEY2'}{'KEY4'}="VALUE"; print Dumper(\%hash); $top = new MainWindow; $top->minsize( qw(300 300)); $men = $top->Frame( )->pack(-side=>"top",-fill=>"x"); $men->Button(-text=>"Dump",-command=>\&dumper)->pack(); test(\%hash); MainLoop(); sub dumper{ print Dumper(\%hash); } sub test{ my $fr = $men->Frame(-relief=>"ridge",-borderwidth=>"2")->pack(-side=>"top",-anchor=>"w",-padx=>"10"); out(\%hash,$fr); } sub out{ # print "OUT\n"; my $ref = shift; my $parent = shift; my $top = $parent->Frame()->pack(-side=>"top",-padx=>"10",-padx=>"4"); my $left = $top->Frame()->pack(-side=>"left",-padx=>"10",-padx=>"4"); my $mid = $top->Frame()->pack(-side=>"left",-padx=>"10",-padx=>"4"); foreach$key ( sort keys %{$ref}){ my $fr = $parent->Frame(-relief=>"ridge",-borderwidth=>"2")->pack(-side=>"top",-anchor=>"w",-padx=>"10"); if (ref $ref->{$key}eq "HASH"){ $fr->Label(-text=>$key)->pack(-side=>"top",-anchor=>"w"); out($ref->{$key},$fr); } if(!ref($ref->{$key}) ) { $left->Label(-text=>$key)->pack(-side=>"top",-anchor=>"w"); $mid->Entry(-text=>$ref->{$key}, -validatecommand=>\&val,-validate=>"focus")->pack(); } } }