With slightly easier to read vars:
sub p{($a,$b,@_)=@_;@*=($b)x(-@_+abs$a);$a>0?(@_,@*):(@*,@_)}
Also the prototype of abs makes this annoying, i thought you could reorder the -@_+abs$a to lose one of the operators but the abs() then requires parens. Nice one by the way. :-)
In reply to Re^2: Golfing Array_Pad [54]
by demerphq
in thread Golfing Array_Pad
by BUU
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |