$^W = 1; use strict; # how to read in!!! my $seikaku; my $kw_pkg; my $cz_pkg; my $foo = `cat tc-dump`; # the no strict "vars" is *ABSOLUT* necessary otherwise the file is not # evaluated, no idea why! no strict "vars"; eval "$foo"; use strict "vars"; # print_keywords($kw_pkg); print "\n===================\nprimary characterizations\n"; walk_cz_tree($cz_pkg->{'primary'}, "PRIM"); print "\n===================\nsecondary characterizations\n"; walk_cz_tree($cz_pkg->{'secondary'}, "SEC"); print "\n===================\nby-function characterizations\n"; walk_cz_tree($cz_pkg->{'by-function'}, "BFUNC"); sub print_keywords { my $kw_pkg = shift; for my $k (keys %$kw_pkg) { my @pkgl = @{$kw_pkg->{$k}}; if (defined(@pkgl)) { print "keyword = $k\n package = @pkgl\n"; } else { print "keyword = $k\n package = NO PACKAGE FOUND!\n"; } } } sub walk_cz_tree { my $cp = shift; my $prestring = shift; if (defined($cp->{'_packages_'})) { my @pkgs = sort @{$cp->{'_packages_'}}; print "$prestring\n"; print "--> @pkgs\n"; } for my $cz (keys %$cp) { if ($cz ne '_packages_') { my $nextstring = "$prestring > $cz"; my $np = $cp->{$cz}; &walk_cz_tree($np,$nextstring); } } }