in reply to Re^2: Surprised by split
in thread Surprised by split

Wouldn't quotemeta avoid this problem, as well as the ones described below?

Replies are listed 'Best First'.
Re^4: Surprised by split
by sk (Curate) on Aug 11, 2005 at 19:14 UTC
    You are right! That should do it!!!

    perl -e ' $str = "hi|there"; $d = quotemeta("|"); @a = split /$d/, $st +r; print +($_,$/) for (@a);' __END__ hi there