Hi,
you can solve this problem by two ways.
1.way ---Using \Q and \E
@line = split /\Q$char\E/, $_;
2. way --- Using 'quotemeta'
$a='abcdef*2dfd'; $char='*'; $char=quotemeta($char); @line=split/$char/, $a; print "@line";
Thanks,
Gopal.R
In reply to Re: Split on metachar
by gopalr
in thread Split on metachar
by EyeOpener
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |