Help for this page
$text = 'a|b|c|||||||||e||||'; @array = split(/\|/,$text); print join '-', @array;
$text = 'a|b|c|||||||||e||||'; # our input might have holes in it! $text =~ s#\|\|#\|NULL\|#g; # make holes read as 'NULL' @array = map { $_ eq 'NULL' ? undef : $_ } split(/\|/,$text); print join '-', @array;