in reply to Code review

Code review: Use meaningful variable names.

Update: The following is wrong. Ignore it.

Simplification:

foreach (@ARGV) { $Y{$y}++,next if $y eq $_; }

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.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: Code review
by Danny (Chaplain) on Mar 06, 2024 at 16:37 UTC
    $Y{$y} += (grep $y eq $_, @ARGV) || 1;
    In the OP, it looks like if @ARGV is true but no $y matches $_ then $Y{$y} should not be incremented. But the above code will increment it.
      You're right, my bad.

      map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]