in reply to Re: pipe delimited file problem
in thread pipe delimited file problem
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).$_ = join '|', map { $_ ||= 'empty' } split( /\|/, $_, -1 );
|
|---|