push ( @soln, $val ) if ( $soln[-1] ne $val );
The brackets around the arguments to push are unnecessary, even in the full-blown if-block you used. With postfix-if you can lose the other brackets too:
push @soln, $val if $soln[-1] ne $val;
I know some folks like the extra brackets but I find removing them aids clarity.
🦛
In reply to Re^2: reduce like iterators
by hippo
in thread reduce like iterators
by LanX
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |