in reply to convert a comma delimited file to a fixed length

The DBD::AnyData module handles both CSV and Fixed Length formats. Here would be the entire script to convert from one to the other:
#!/usr/bin/perl -w use strict; use DBI; my $pattern = {pattern=>'A6 A9 A8 A5 A3'}; # widths of cols my $dbh=DBI->connect('dbi:AnyData(RaiseError=1):'); $dbh->ad_catalog('T1','CSV','yourfile.csv'); $dbh->ad_catalog('T2','Fixed','yourfile.fix',$pattern); $dbh->do("CREATE TABLE T2 AS SELECT * FROM T1"); __END__
If you don't like SQL, the AnyData module will let you do the same thing with a tied-hash interface.