I think you are correct in pursuing sprintf as one good way to skin this cat. But I must admit, I personally prefer working with delimited records to fixed-length records any day of the week. Are you sure you can't do this with a delimiter, rather than fixed-length?
If you decide you must use a fixed-length strategy, you might try declaring a hash with attribute names and expected string length (or other formatting instructions). Then you could pass each form input to a standard write_me() routine that would look up the appropriate formatting instruction and write it out to your file (or whatever).
I'm sure there are lots of TIMTOWTDI variations. :)
In reply to Re: Best way(s) to process form data into fixed-length values?
by ptum
in thread Best way(s) to process form data into fixed-length values?
by hmbscully
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |