Subject: | Patch for Term::UI |
Date: | Fri, 24 Apr 2009 14:46:18 +1000 |
To: | bug-term-ui [...] rt.cpan.org, kane [...] cpan.org |
From: | Christian King <urzumph [...] gmail.com> |
Hi,
When get_reply is called with no default option and warnings turned
on, this line produces a lot of warnings (1 per choice) about using an
uninitialised value. The below patch seems to fix them.
*** /usr/share/perl/5.10/Term/UI-vendor-0.18.pm 2009-04-25
00:30:01.000000000 +1000
--- /usr/share/perl/5.10/Term/UI-cjk-0.18.pm 2009-04-25
00:33:55.000000000 +1000
***************
*** 147,153 ****
### so this choice is the default? add it to 'prompt_add'
### so we can construct a "foo? [DIGIT]" type prompt
! $prompt_add = $i if $choice eq $args->{default};
### create a "DIGIT> choice" type line
$args->{print_me} .= sprintf "\n%3s> %-s", $i, $choice;
--- 147,153 ----
### so this choice is the default? add it to 'prompt_add'
### so we can construct a "foo? [DIGIT]" type prompt
! $prompt_add = $i if (defined $args->{default} and
$choice eq $args->{default});
### create a "DIGIT> choice" type line
$args->{print_me} .= sprintf "\n%3s> %-s", $i, $choice;