Help for this page
#Returns a copy of the input padded to size specified by pad_size with + value pad_value. #If pad_size is positive then the array is padded on the right, if it' +s negative then on the left. ... return @array; }#else }#array_pad
sub p{my($i,$z,@f)=@_;abs$i>@f&&$i<0?@f=(($z) x abs($i+@f),@f):(@f[@f. +.$i-1]=($z)x($i-@f));@f}
use Test::More tests => 4; ... is_deeply([p(-3, 'x', @x)], [ @x ]); is_deeply([p( 7, 'x', @x)], [ @x, 'x', 'x' ]); is_deeply([p(-7, 'x', @x)], [ 'x', 'x', @x ]);