my @fields = split "|", 'abc|def'; print join ', ', @fields; # a, b, c, |, d, e, f