I prefer to use \Q$var\E in regular expressions when I want to treat the variable's contents as a string (not interpret it is a regular expression). So I'd write:
but you could also use quotemeta or structure it in several different ways.@field_list = split /\Q$self->{delimiter}\E/, $field_line, -1;
I'll take a guess that your delimiter is "|".
- tyeIn reply to Re: Splitting on Variable
by tye
in thread Splitting on Variable
by Angel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |