[Lxr-commits] CVS: lxr/scripts QuestionAnswer.pm,1.2,1.3
Brought to you by:
ajlittoz
From: Andre-Littoz <ajl...@us...> - 2013-09-02 17:06:07
|
Update of /cvsroot/lxr/lxr/scripts In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25291/scripts Modified Files: QuestionAnswer.pm Log Message: scripts/QuestionAnswer.pm: various source minor mprovements Index: QuestionAnswer.pm =================================================================== RCS file: /cvsroot/lxr/lxr/scripts/QuestionAnswer.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- QuestionAnswer.pm 4 Dec 2012 17:42:27 -0000 1.2 +++ QuestionAnswer.pm 2 Sep 2013 17:06:03 -0000 1.3 @@ -43,7 +43,7 @@ my ($list) = @_; my @pats; - my $flat = "#" . join("#", @$list); + my $flat = '#' . join('#', @$list); PAT: foreach my $pat (@$list) { my $pfix = "#"; @@ -52,8 +52,8 @@ $pfix .= $c; if (1 == (@_ = $flat =~ m/$pfix/ig)) { my $sl = @chars; #suffix length - $pfix .= "("x($sl>0) . join("(", @chars) . ")?"x$sl; - push(@pats, "^" . substr($pfix, 1)); + $pfix .= '('x($sl>0) . join('(', @chars) . ')?'x$sl; + push(@pats, '^' . substr($pfix, 1)); next PAT; } } @@ -87,7 +87,7 @@ || !defined($answers) || @$choices != @$answers ) { - print "${VTred}FATAL:${VTnorm} incorrect choices and/or answers for $question!\n"; + print "${VTred}FATAL:${VTnorm} incorrect choices and/or answers for \"$question\"!\n"; exit 2; } if ($default >= @$choices) { @@ -122,13 +122,13 @@ chomp($userentry); # See if user just hit "return"; if this is valid, give # default answer, otherwise ask again. - if ($userentry eq "") { + if ($userentry eq '') { if ($default >= 0) { return $$answers[$default]; } elsif ($default == -2) { return $$answers[0]; } elsif ($default == -4) { - return ""; + return ''; } print "No default choice, try again...\n"; next; |