or download this
my $term = new Term::ReadLine 'Command Line Interface';
my $attribs = $term->Attribs;
...
$attribs->{completion_word} = &getTabCompletionArray(\@tmp);
return $term->completion_matches($text, $attribs->{list_completion_f
+unction});
}