summaryrefslogtreecommitdiffstats
path: root/perl-install/interactive_stdio.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-08-24 19:02:16 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-08-24 19:02:16 +0000
commit10b649b6503f47388f1548c8ba9391dd6ce0284e (patch)
tree6bc1fe238a7a28721cfd15b52946e67d236c8277 /perl-install/interactive_stdio.pm
parented18d4ad1743445dc1c49d65b5a64a0c73510edd (diff)
downloaddrakx-10b649b6503f47388f1548c8ba9391dd6ce0284e.tar
drakx-10b649b6503f47388f1548c8ba9391dd6ce0284e.tar.gz
drakx-10b649b6503f47388f1548c8ba9391dd6ce0284e.tar.bz2
drakx-10b649b6503f47388f1548c8ba9391dd6ce0284e.tar.xz
drakx-10b649b6503f47388f1548c8ba9391dd6ce0284e.zip
no_comment
Diffstat (limited to 'perl-install/interactive_stdio.pm')
-rw-r--r--perl-install/interactive_stdio.pm18
1 files changed, 11 insertions, 7 deletions
diff --git a/perl-install/interactive_stdio.pm b/perl-install/interactive_stdio.pm
index de848b9e6..6fb1fd58c 100644
--- a/perl-install/interactive_stdio.pm
+++ b/perl-install/interactive_stdio.pm
@@ -55,14 +55,14 @@ sub ask_from_listW {
}
}
-sub ask_many_from_listW {
- my ($o, $title, $messages, $list, $default) = @_;
+sub ask_many_from_list_refW {
+ my ($o, $title, $messages, $list, $val) = @_;
my @defaults;
print map { "$_\n" } @$messages;
my $n = 0; foreach (@$list) {
$n++;
print "$n: $_\n";
- push @defaults, $n if $default->[$n - 1];
+ push @defaults, $n if ${$val->[$n - 1]};
}
my $i;
TRY_AGAIN:
@@ -70,11 +70,15 @@ sub ask_many_from_listW {
print _("Your choice? (default %s enter `none' for none) ", join(',', @defaults));
$i = readln();
my @t = split ',', $i;
- foreach (@t) { check_it($_, $n) or goto TRY_AGAIN }
+ if ($i =~ /^none$/i) {
+ @t = ();
+ } else {
+ foreach (@t) { check_it($_, $n) or goto TRY_AGAIN }
+ }
- my @rr = (0) x @$list;
- $rr[$_ - 1] = 1 foreach @t;
- @rr;
+ $$_ = 0 foreach @$val;
+ ${$val->[$_ - 1]} = 1 foreach @t;
+ $val;
}