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 {
|
sub shell_quote {
|
||||||
# shell-escape argument for inclusion in non-interpolated single quotes
|
# shell-escape argument for inclusion in non-interpolated single quotes
|
||||||
my @words = @_;
|
my @words = @_;
|
||||||
my @transformed = map {
|
foreach my $word (@words) {
|
||||||
(my $out = $_)
|
$word =~ s/'/'\\''/g;
|
||||||
=~ s/'/'\\''/g;
|
$word = "'$word'";
|
||||||
"'$out'";
|
}
|
||||||
} @words;
|
return wantarray ? @words : $words[0];
|
||||||
return wantarray ? @transformed : $transformed[0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue