in reply to Getting info with a small flatfile db.

hi!

as usually, there are quite a lot of ways to do it. although you could write the code for parsing a individual line yourself, using split or regular expressions, i would recommend to use a module like Text::CSV_XS that does the work for you.

some sample code could look like this:
use Text::CSV_XS; my $csv = Text::CSV_XS->new({ 'quote_char' => '"', 'escape_char' => '"', 'sep_char' => '|', 'binary' => 1 }); while my $line (<YOURFILE>) { if ($csv->parse($line)) { my @field = $csv->fields; my $count = 0; for $column (@field) { print ++$count, " => ", $column, "\n"; } print "\n"; } else { my $err = $csv->error_input; print "parse() failed on argument: ", $err, "\n"; } }

snowcrash //////