my @items = grep {$_} split '"', '"ab"cde"fgh"'; print join '|', @items; #### ab|cde|fgh