- or download this
$foo = '^';
m/$foo/
- or download this
my $str = "acb^def^123^456";
my $foo = '^';
...
my @fields = split /$foo/, $str;
my $out = join '|', @fields;
print "$out\n";
- or download this
my $str = "acb\tdef\t123\t456";
my $foo = "\t";
- or download this
"first,field","second,""field"with','junk","third'field