go ahead... be a heretic | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I think split behaves differently if the first parameter is a normal string instead of a regex. The perlfunc documentation doesn't mention this and I can't remember how exactly it differs. Anyway since | is a regex special character (alternation) you need to escape it. I'd normally write this as: split /\|/, $strThe reason you need two \s is because of the behaviour of double quotes - just try:
and you should see what's happening. s^^unp(;75N=&9I<V@`ack(u,^;s|\(.+\`|"$`$'\"$&\"\)"|ee;/m.+h/&&print$& In reply to Re: Surprised by split
by muntfish
|
|