in reply to working with non-delimited files

I'd use split & join, rather than regex...

print join "|", split /\s+/, $_, 6 for <DATA>