in reply to Extract data from pipe delimited text

If I remember correctly (which doesn't always happen), I believe Mysql STDOUT query output (which is what you, I believe, are parsing), uses "\s+|\s+" in between columns. Unless you are just talking about a flat file with pipe as the delimeter that you can THEN slap into mysql, wherein I believe

while (my $line = <>) { my $category = split("|", $line, 1); # ... }
would get the job done.