I don't see how that is supposed to work.
It's supposed to work because, as ikegami pointed out, you use the -0777 switch to make the interpreter slurp the whole file in one go, the equivalent of undefining $/ in a script. Thus, the global replace operates on a single string which is the whole file and the while implied by -p only iterates once.
I hope this is helpful.
Cheers,
JohnGG
In reply to Re^3: Adding back missing newlines between records
by johngg
in thread Adding back missing newlines between records
by puterboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |