theorbtwo answered your problem with split /|/, I suggest that you use the magic
split ' ', $line or if working on $_, simply
split. This splits on one or more whitespace and ignores empty fields (because of spurious whitespace) at the start and end of your line which should work best in your case.
-- Hofmator