while ( ) { next if ($. == 1); if ($csv->parse($_)) { my @columns = $csv->fields(); # print the parsed body of old file print TEMP "$columns[0], $columns[2], $columns[1], $columns[3], $columns[0]\n"; #while( ) #{ #print TEMP $_; #last if $. % 1; #} } else { my $err = $csv->error_input; Lava::Message("Failed to parse line: $err"); } }