in reply to pipe as a delimiter

Try split(/\|/, $line).