in reply to Best way(s) to process form data into fixed-length values?
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. :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Best way(s) to process form data into fixed-length values?
by hmbscully (Scribe) on Jul 25, 2006 at 20:23 UTC |