in reply to Generating standard length strings
... although after reading all the responses, I agree that sprintf is the best way to go.sub pad{ my ($string, $length) = @_; return (length($string) < $length ? pack("A$length", $string) : $st +ring); }
|
|---|