summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-08-06 13:43:26 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-08-06 13:43:26 +0000
commit21fbfdfead833c685b255edb3c3460198ce89877 (patch)
tree53d5fe3042a57097040f468982deb062737fe26a /perl-install/interactive.pm
parentf18434c76326cf6c58d24dc67ef4707ec72f400d (diff)
downloaddrakx-21fbfdfead833c685b255edb3c3460198ce89877.tar
drakx-21fbfdfead833c685b255edb3c3460198ce89877.tar.gz
drakx-21fbfdfead833c685b255edb3c3460198ce89877.tar.bz2
drakx-21fbfdfead833c685b255edb3c3460198ce89877.tar.xz
drakx-21fbfdfead833c685b255edb3c3460198ce89877.zip
no_comment
Diffstat (limited to 'perl-install/interactive.pm')
-rw-r--r--perl-install/interactive.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm
index 0ef20cc19..bad32cf8d 100644
--- a/perl-install/interactive.pm
+++ b/perl-install/interactive.pm
@@ -86,7 +86,7 @@ sub ask_okcancel($$$;$) {
sub ask_from_list_ {
my ($o, $title, $message, $l, $def) = @_;
- ask_from_listf($o, $title, $message, sub { translate($_[0]) }, @$l, $def);
+ ask_from_listf($o, $title, $message, sub { translate($_[0]) }, $l, $def);
}
sub ask_from_listf_ {
@@ -95,10 +95,12 @@ sub ask_from_listf_ {
}
sub ask_from_listf {
my ($o, $title, $message, $f, $l, $def) = @_;
- my %l; my $i = 0; foreach (@$l) {
- $l{$f->($_, $i++)} = $_;
+ my (@l,%l); my $i = 0; foreach (@$l) {
+ my $v = $f->($_, $i++);
+ push @l, $v;
+ $l{$v} = $_;
}
- my $r = ask_from_list($o, $title, $message, [ keys %l ], $f->($def)) or return;
+ my $r = ask_from_list($o, $title, $message, \@l, defined $def ? $f->($def) : $def) or return;
$l{$r};
}