join "|" => map {length () ? $_ : '\N'} split /[|]/ => $line, -1; #### $line =~ s'[|](?=[|])'|\N'g;