From: Eric Wong Date: Wed, 16 Apr 2014 19:43:25 +0000 (+0000) Subject: ssoma: use implicit $_ for simpler arg generation X-Git-Tag: v0.0.0~11 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=31a7001b38427163276645450129bb537982de24;p=ssoma-mda.git ssoma: use implicit $_ for simpler arg generation This makes the loop shorter and judicious use of $_ is OK. --- diff --git a/ssoma b/ssoma index c575e3d..1f68f6b 100755 --- a/ssoma +++ b/ssoma @@ -73,13 +73,13 @@ sub usage { } my $opt = $cmd{$c}->{opt} or next; - foreach my $s (sort keys %$opt) { + foreach (sort keys %$opt) { # prints out arguments as they should be passed: my $x = s#[:=]s$## ? '' : (s#[:=]i$## ? '' : ''); - print $fd ' ' x 21, join(', ', map { length $s > 1 ? - "--$s" : "-$s" } - split /\|/, $s)," $x\n"; + print $fd ' ' x 21, join(', ', map { length $_ > 1 ? + "--$_" : "-$_" } + split /\|/, $_)," $x\n"; } } exit $exit;