On Sat, Jul 05, 2003 at 09:04:18PM -0700, Madhu Reddy wrote: > > then of recors length is more than 25, delete the > chars after 25...basically truncate record length to > 25 > > and if record length is less than 25 add some spaces > to make record length 25.....
Either sprintf() or pack() would do the trick. $record = sprintf("%-25.25s", $record); $record = pack("A25", $record); That "A" is for ASCII, though; if you need something more sophisticated, have a look at: % perldoc -f pack HTH -- Steve -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]