in reply to Re: pipe delimited file problem
in thread pipe delimited file problem

But if you're going to use split in a situation like this, be sure you tell it not to drop "trailing nulls":
$_ = join '|', map { $_ ||= 'empty' } split( /\|/, $_, -1 );
The third arg to split() (set to "-1") is important here. Without it, one or more instances of "|" at the end of the string will simply be ignored, and the output could have a variable number of records per line (which might cause trouble downstream).