From 33ff0afcc8698cac0b050749878dd9e95ae51f1a Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sun, 28 Jul 2002 21:51:36 +0000 Subject: fix "nicer error message when {val} is not set for ask_from & list" in case of a reference to a reference (ref is REF instead of SCALAR) --- perl-install/interactive.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perl-install') diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index ebbd14fc9..6a9f488a9 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -262,7 +262,7 @@ sub ask_from_normalize { foreach my $e (@$l) { if (my $li = $e->{list}) { - ref $e->{val} eq 'SCALAR' or internal_error($e->{val} ? "field {val} must be a reference" : "field {val} is mandatory"); + ref($e->{val}) =~ /SCALAR|REF/ or internal_error($e->{val} ? "field {val} must be a reference (it is $e->{val})" : "field {val} is mandatory"); if ($e->{sort} || @$li > 10 && !exists $e->{sort}) { my @l2 = map { may_apply($e->{format}, $_) } @$li; my @places = sort { $l2[$a] cmp $l2[$b] } 0 .. $#l2; -- cgit v1.2.1