ActivePerl Term::ReadLine and cygwin
Sagar R. Shah
Sagar.Shah@sid.cam.ac.uk
Thu Dec 21 13:00:00 GMT 2000
Hi All
I'm getting some unexpected behaviour with a perl program that is designed
to ask the user for parameters here's the example perl code:
-----
use Term::ReadLine;
my($ftp, $cfg, $term);
my(@filelist, @binary_extensions, @config_options, @files);
my(%clo, %options, %commands);
$term = new Term::ReadLine 'terminal';
@config_options = ('host', 'user', 'pwd', 'ldir', 'rdir');
foreach my $opt (@config_options) {
$options{$opt} = $term->readline("Enter " . $opt . ": ");
}
------
so this should ask the super for 5 values, one at a time.
However when I run it from bash (with CYGWIN=binmode), what occurs is that
bash skips past the first prompt (entering nothing for it) and goes to the
second prompt:
----
$ perl abc.pl
Enter host:
Enter user:
----
Subsequent presses of the enter key proceed as normal (one propt at a time).
I'm using windows ActivePerl rather than the cygwin port, but this shouldn't
really be a problem in this case (i think). I'm using the latest version of
CYGWIN.
I tried setting CYGWIN=tty, in this case it does stop at the first prompt,
but hangs when I enter my value and press enter.
It seems to me as if I've got bash/cygwin configured incorrectly.
Does anyone have any ideas? [cygcheck -v -s -r attached]
Or has anyone else got similar code to run with cygwin and activerperl?
Does it work fine with cygwin and the cygwin-perl port?
Thanks
Sagar
More information about the Cygwin
mailing list