Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
s = s.PadRight(m, c);
s = s.padEnd(m, c);
while (s.length() < m) s = s + c;
$s .= $c x ($m - length $s)
String $c (one character) is repeated $m - length $s times. Perl generates an empty string if the repeat count is zero or negative. The result is appended to $s (by the .= operator, similar to +=).
$s = length($s) >= $m ? $s : $s . $c x ( $m-length($s) );
The . operator concatenates; the x operator repeats a string on the left by the count on the right. For compactness, ? : is used instead of if-else. A more idiomatic approach would avoid calling length() twice.
s = s.ljust(m, c)
s = f'{s:{c}<{m}}'
s = s.ljust(m, c)