in reply to Converting fixed record length files to pipe delimited

PLEASE,
be careful with those <pre> tags and use <code> tags to format your code.

It would be useful, if you told us what exactly is not working. A quick glance at your code shows that you got a somewhat un-perlish writing ;-)

Maybe you should make yourself comfortable with the split() command. You could do something like

($field1, $field2, undef, undef ...) = split /\s+/, $line;

which discardes the undef parts and let's you use the parts you wanted to have....

Regards Stefan K