in reply to Parsing pipe-delimited text that contains pipes

Another (dumb) q (sorry, CSV newbie here): I can see how to use Text::CSV to parse files, but how do I parse an array? All I see is while (my $row = $csv->getline ($fh)) from a $fh file handle.

Replies are listed 'Best First'.
Re^2: Parsing pipe-delimited text that contains pipes
by haukex (Archbishop) on Aug 12, 2019 at 19:00 UTC
    I can see how to use Text::CSV to parse files, but how do I parse an array?
    $csv->parse($string) or die "failed to parse '$string'"; my @fields = $csv->fields;

    Update: I assume you meant how to parse a string instead of an array. If not, please show (with code!) what you mean.

      Yes that was what I meant (an array of strings) and was looking for, thank you!