in reply to surprised by split

Update: Removed my earlier bad advice, since the pipe is definitely NOT escaped in a quoted string.
print join "\n", split('|', "blush");
gives
b l u s h
See good advice above and below. :)

Replies are listed 'Best First'.
Re: Re: split
by John M. Dlugosz (Monsignor) on Aug 08, 2001 at 02:05 UTC
    According to perlfunc, “The pattern /PATTERN/ may be replaced with an expression to specify patterns that vary at runtime.&rdquo

    So a quoted string is an expression whose value never changes, and that will be compiled into a regex each time. It offers the same issues of double-escape and shifting meanings of escapes as /$foo/ does.