No such thing as a small change | |
PerlMonks |
Re: Terminal. Update text while user types. -- glob and Term::ReadLine solutionby Discipulus (Canon) |
on Dec 21, 2016 at 08:38 UTC ( [id://1178278]=note: print w/replies, xml ) | Need Help?? |
Hello Bad_ptr and welcome to active participation to the monastery! If i understand your needs, you can accomplish something very similar via Term::ReadLine and glob Infact that module has autocompletion via TAB key. If you press TAB twice it display all possible valid combinations based on what you entered till now. I see you use *.pl as pattern; if i understand your needs you can read the pattern enetered at the prompt and use glob to populate an array. You'll use this array to do the autocompletion. That module is somehow tricky to use correctly and behaves differently depending on the OS. Here you have a working solution:
If I call this program in the current directory I see (some space and comments added):
I suggest you to read Re^3: about Term::ReadLine and it's imported function The Solution and the whole thread because Term::ReadLine is a bit dificult to manage. HtH L*
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
In Section
Seekers of Perl Wisdom
|
|