in reply to pipe delimited file problem

Another way to do it is to repeat the substitution until it fails; this may be less efficient but it often conserves brain time:
while (s/\|\|/|empty|/g) {};
or the semi-golf version
1 while s/\|\|/|empty|/g;