in reply to working with non-delimited files

If the requirements are that the first five fields are space delimited, and the last field is the rest of the line, then just use the LIMIT argument of split:
my @fields = split " ", $line, 6; print join("|", @fields);

Update: Hmm, I thought I read all the replies, but FunkyMonk already had it.