in reply to Code review
Update: The following is wrong. Ignore it.
foreach (@ARGV) { $Y{$y}++,next if $y eq $_; }
$Y{$y} += grep $y eq $_, @ARGV;
This can replace the whole if/else.$Y{$y} += (grep $y eq $_, @ARGV) || 1;
It's unclear what happens in the ellipses. Note that if 0 is in @ARGV, it won't be counted in %Y because of next unless $y.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Code review
by Danny (Chaplain) on Mar 06, 2024 at 16:37 UTC | |
by choroba (Cardinal) on Mar 06, 2024 at 16:43 UTC |