I once used Text::FixedLength and added Text::FixedLength::Extra for this, but I'm not sure what it has over pack() which is part of Perl... I never could grok pack() for some reason.
Comment on Re: Best way(s) to process form data into fixed-length values?