MT#62763 Do not modify topic variable in list functions

Warned-by: perlcritic
Fixes: ControlStructures::ProhibitMutatingListFunctions
Change-Id: I1917e796749975e4889312ee2c72608c0ecc95d9
mr13.4
Guillem Jover 12 months ago
parent b49f926f6d
commit d8ddcc7749

@ -238,7 +238,12 @@ sub process_file {
open(my $fh, '<:encoding(UTF-8)', $filename) or die "Could not open file '$filename' $!";
my @rows = ();
while (my $row = <$fh>) {
my @cleaned = map { $_ = s/NULL//gr =~ s/[\r\n]//gir; length($_) > 0 ? $_ : undef; } split(/,/,$row);
my @cleaned = map {
my $col = $_;
$col =~ s/NULL//g;
$col =~ s/[\r\n]//gi;
length $col > 0 ? $col : undef;
} split /,/, $row;
push(@rows,{
id => $cleaned[0],
time_set_id => $cleaned[1],

@ -168,7 +168,15 @@ sub get_opt{#get $opt
"test-groups" ,
) or pod2usage(2);
my @opt_keys = keys %$opt_in;
@{$opt}{ map{ s/\-/_/; } @opt_keys } = map {my $v = $opt_in->{$_}; $v={ map {$_=>1;} split(/[^[:alnum:]]+/,$v ) }; $v;} @opt_keys ;
@{$opt}{ map{ s/\-/_/r; } @opt_keys } = map {
my $v = $opt_in->{$_};
$v = {
map {
$_ => 1;
} split(/[^[:alnum:]]+/, $v)
};
$v;
} @opt_keys;
print Dumper $opt;
pod2usage(1) if $opt->{help};
pod2usage(1) unless( 1

Loading…
Cancel
Save