This queue is for tickets about the IO-Prompt CPAN distribution.

Report information
The Basics
Id:
29476
Status:
new
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
kclark [...] cpan.org
Cc:
AdminCc:

BugTracker
Severity:
Wishlist
Broken in:
v0.99.4
Fixed in:
(no value)



Subject: Use integers for '-menu' instead of letters
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 966
I've hacked my version of IO::Prompt to use integers instead of letters for the "-menu" items. I often have more than 26 options. ky diff Prompt.pm Prompt.orig 535a536
Show quoted text
> croak "Too many -menu items" if $count > 26;
538c539 < my $max_char = $count - 1; ---
Show quoted text
> my $max_char = chr(ord('a') + $count - 1);
542c543 < my $next = 1; ---
Show quoted text
> my $next = 'a';
556c557 < my $prompt_range = "(Please enter 1-$max_char) > "; ---
Show quoted text
> my $prompt_range = "(Please enter a-$max_char) > ";
568c569 < elsif ($response < 1 || $response > $max_char ) { ---
Show quoted text
> elsif (length $response > 1 || ($response lt 'a' ||
$response gt $max_char) ) { 575c576 < elsif ($require and my $mesg = $require->($data[$response-1])) { ---
Show quoted text
> elsif ($require and my $mesg =
$require->($data[ord($response)-ord('a')])) { 581c582 < my $selection = $data[$response-1]; ---
Show quoted text
> my $selection = $data[ord($response)-ord('a')];


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.