in reply to Tab completion for mundane input in perl

This can be done with Term::ReadLine.

Take a look at this wise reply of shmem: Re: Autocomplete in perl console application

Update:

Some sample code using another module, Term::Complete. Tested under Cygwin console.

#!/usr/bin/perl -w use strict; use Term::Complete; my %hash = ( key1 => 'value1', key2 => 'value2', anotherkey => 'value3', fourthone => 'value4', ); my $user_input = Term::Complete::Complete('Try to input hash key: ', k +eys %hash);

Regards,
Luke

Replies are listed 'Best First'.
Re^2: Tab completion for mundane input in perl
by addy2000 (Initiate) on Jul 15, 2009 at 05:40 UTC
    Thx!!

    That did it for me

Re^2: Tab completion for mundane input in perl
by jimhar66 (Initiate) on Feb 04, 2011 at 18:49 UTC
    Hello, I am having problems with cygwin using Term::Complete. Are there modifications required to module for it to work under cygwin? Seems to work fine under linux. Thanks,