Subject: | Tools::Term bug |
distribution: Tools-0.04
perl: v5.8.1 built for i686-linux
OS: Linux 2.4.18-bf2.4 i686 GNU/Linux
It's a Debian testing, meaning all the latest packages.
Following code, taken from your documentation, fails:
CODE:
---------------------------------------
#!/usr/local/bin/perl -w
use strict;
use Term::ReadLine;
use Tools::Term;
my $term = Term::ReadLine->new('brand');
my $reply = $term->get_reply
(
prompt => 'What is your favourite colour?',
choices => [ 'one', 'two', 'three' ],
default => 'blue',
);
------------------------------------------------------------
PRINTS OUT:
------------------------------------------
Show quoted text
1> one
Show quoted text 2> two
Show quoted text 3> three
Show quoted text 1> oneyour favourite colour? r?
Show quoted text 2> two
Show quoted text 3> three
What is your favourite colour? r?
--------------------------------------------
which is obviously wrong.
However, when the same code is run with options that you use in your tests
----------------------
$Tools::Term::AUTOREPLY = 1;
$Tools::Term::VERBOSE = 0;
--------------------------
it prints out correctly:
--------------------------------
Show quoted text 1> one
Show quoted text 2> two
Show quoted text 3> three
What is your favourite colour?
------------------------------------
Which means that although your tests will pass, the module is broken and unusable. Feels like an easy fix to me thou.
reagads,
toni