The default separator for the
fromCSV command is a comma, i.e. comma-separated values. Your file appears to contain pipe-separated values, so you need to define the delimiter. The
Data::Table documentation for the
fromCSV command states,
if the delimiter or the qualifier is a special symbol in regular expre
+ssion, you must escape it by '\'. For example, in order to use pipe s
+ymbol as the delimiter, you must specify the delimiter as '\|'.
Try this with your file,
my $t = Data::Table::fromCSV("ravi.csv", 0, undef, { delimiter => '\|'
+ });