use Term::ReadLine; my @commands = qw(one two three four five six seven eight nine ten); my $term = Term::ReadLine->new('test'); if (my $attr = $term->Attribs) { my $pkg = Term::ReadLine->ReadLine(); print "package is $pkg\n"; $term->ornaments(0); $attr->{basic_word_break_characters} = ". \t\n"; $attr->{completer_word_break_characters} = " \t\n"; $attr->{completion_function} = \&complete_word; $attr->{completion_suppress_append} = 1; # doesn't work! :( $attr->{completion_append_character} = "\0"; # nor this } while (1) { my $Command = $term->readline("Cmd>"); print "command:>$Command<\n"; } sub complete_word { my ($text, $line, $start) = @_; return grep(/^$text/, @commands); }