in reply to
Padding with \s
My favorite method uses pack:
$str = pack('A40',$str);
[download]
Note that this will truncate the string if it is longer than 40 characters.
--Jim
Comment on
Re: Padding with \s
Download
Code
In Section
Seekers of Perl Wisdom