while() { chomp; my ($one, $two, $three, $four) = split /\:/, $_; push @{$DATA->{$one}{$two}{$three}}, $four; } sub choice { my @a; my $x = 0; while (my ($key, $value) = each %$DATA) { print "$x - $key\n"; push @a, $key; $x++; } print "select : "; chomp(my $a = ); my @b; my $c = 0; while (my ($key, $value) = each %{$$DATA{$a[$a]}}) { print "$c - $key\n"; push @b, $key; $c++; } print "select : "; chomp(my $b = ); my @d; my $e = 0; while (my ($key, $value) = each %{$$DATA{$a[$a]}{$b[$b]}} ) { print "$e - $key\n"; push @d, $key; $e++; } print "select : "; chomp(my $new = ); #PRINT SELECT ARRAY my @counter = 0; foreach(@{$$DATA{$a[$a]}{$b[$b]}{$d[$new]}}) { print "$counter - $_\n"; $counter++; } print "select : "; chomp(my $count = ); #DO SOMETHING WITH $counter[$count] } __END__ category1:category2:category3:options categorya:categoryb:categoryc:more options categoryd:categorye:categoryf:even more options