for my $category ( @cat ) { next unless exists $data{ $category }; print "Submenu = \"$category\" {\n"; . . . . .