use Text::CSV_XS; my $csv = Text::CSV_XS->new( sep_char => '|' ); while ( <> ) { $csv->parse( $_ ); my ( $file, $file_list, $yes_no ) = $csv->fields; print "$_ $yes_no\n" for $file, split /,/, $file_list; }