Something like:
use strict; use warnings; my $str = 'acb^def^123^456'; my $foo = '^'; my @fields = split /\Q$foo\E/, $str; print join '|', @fields;
Prints:
acb|def|123|456
In reply to Re: escaping variables in regexp
by GrandFather
in thread escaping variables in regexp
by Getch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |