mirror of
https://codeberg.org/h3xx/simplify_static_dir
synced 2024-08-14 23:57:24 +00:00
Fix overly-complex 'map' (PBP)
This commit is contained in:
parent
7d389377a1
commit
e0c91b4647
1 changed files with 5 additions and 6 deletions
|
@ -39,12 +39,11 @@ sub hr_size {
|
|||
sub shell_quote {
|
||||
# shell-escape argument for inclusion in non-interpolated single quotes
|
||||
my @words = @_;
|
||||
my @transformed = map {
|
||||
(my $out = $_)
|
||||
=~ s/'/'\\''/g;
|
||||
"'$out'";
|
||||
} @words;
|
||||
return wantarray ? @transformed : $transformed[0];
|
||||
foreach my $word (@words) {
|
||||
$word =~ s/'/'\\''/g;
|
||||
$word = "'$word'";
|
||||
}
|
||||
return wantarray ? @words : $words[0];
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
Loading…
Reference in a new issue