use strict; use vars qw/%hash/; use Tk; use Tk::TList; use Tk::HList; my $mw = MainWindow->new(); my $image = $mw->Getimage('folder'); my $tlist = $mw->TList(-orient => 'vertical'); my $label = $mw->Label(-width=>15); my $hlist = $mw->HList( -itemtype => 'text', -separator => '!', -selectmode => 'single', -browsecmd => sub { my $file = shift; $label->configure(-text=>$file); }); chomp (my @work_file=); for (@work_file) { next if ($_ !~ m!,!); @data = split (/[,\s]+/,$_); $ref = \%hash; foreach (@data) { $ref->{$_} = {} if (not defined $ref->{$_}) $ref = $ref->{$_}; } } foreach my $bu (keys %hash) { $hlist->add($bu, -text=>$bu); foreach my $group (keys %{$hash{$bu}}) { $hlist->add("$bu!$group", -text => $group); foreach my $function (keys %{$hash{$bu}->{$group}}) { $hlist->add("$bu!$group!$function", -text => $function); } } } $hlist->pack; $label->pack; MainLoop; __DATA__ Dept Group Function IT, Projects, SAN/NAS IT, Development, GUI IT, Security, HR, Admin, West HR, Management, West Legal, Admin, FirmWide Legal, Compliance,