#10019 Changed smartmatch

This commit is contained in:
Daniel Maya 2022-12-14 12:24:56 +01:00
parent 50b7fc7c7a
commit 1b2e3c0046
1 changed files with 1 additions and 2 deletions

View File

@ -1296,7 +1296,6 @@ sub help_screen_line($$$){
sub check_values($) { sub check_values($) {
my ($check) = @_; my ($check) = @_;
use experimental 'smartmatch';
my $arg_cont = 2; my $arg_cont = 2;
my $cont = 0; my $cont = 0;
@ -1316,7 +1315,7 @@ sub check_values($) {
# Check values. # Check values.
if (defined($check->[$cont]->{'values'})) { if (defined($check->[$cont]->{'values'})) {
if (!($args[$arg_cont] ~~ $check->[$cont]->{'values'})) { if (!(is_in_array($check->[$cont]->{'values'}, $args[$arg_cont]))) {
print "\nError: value `$args[$arg_cont]` is not valid for $check->[$cont]->{'name'}\n"; print "\nError: value `$args[$arg_cont]` is not valid for $check->[$cont]->{'name'}\n";
print "\tAvailable options: \t$check->[$cont]->{'values'}->[0]"; print "\tAvailable options: \t$check->[$cont]->{'values'}->[0]";
if (defined($check->[$cont]->{'text_extra'}->[0])) { if (defined($check->[$cont]->{'text_extra'}->[0])) {