sub doInput($$;$) { my $term = ${$_[0]}; my $selectList = $_[1]; # This is already a REFERENCE! my $promptStr = $_[2] if $_[2]; # Set the prompt string to empty string if there is no 3rd arg. ! $promptStr and $promptStr = ''; # The code below, up to the return(), is pulled from the pftp # readline example file. Thanks to Hiroo Hayashi for the Gnu # ReadLine code. my $attribs = $term->Attribs; # This is the list of things to expand on. $attribs->{completion_word} = $selectList; $attribs->{completion_append_character} = ''; $attribs->{completion_entry_function} = $attribs->{'list_completion_function'}; # Check the length of $promptStr, if > 78 characters, append # newline length $promptStr > 78 and $promptStr .= "\n"; my $userInput = $term->readline($promptStr); $attribs->{completion_append_character} = ' '; $attribs->{completion_entry_function} = undef; return $userInput; }