or download this
my $term = new Term::ReadLine 'Command Line Interface';
my $attribs = $term->Attribs;
$attribs->{completion_entry_function} = $attribs->{'list_completion_fu
+nction'};
$attribs->{completion_word} = \@commands; # array of supported comma
+nds