Re: split()'s pattern argument



"Jerry Adair" <jerry.adair@xxxxxxx> wrote:
Hello-

'Encountering something weird (well weird to me), 'couldn't find it in
the FAQ:

when attempting to call split() with a value to "split on" that is stored
in a scalar, I get behavior other than what I expected. The Camel book
says to just put it inside match delimiters, but that doesn't help the
cause. Thus:

@line = split( /$separator/ );

doesn't do what I thought it would, as if $separator was replaced with:

@line = split( " " );

split " " is a special case, and does not do the same thing as split / /.
A variable which contains a space will give you the split / / behavior, not
the special-case split " " behavior.

This was discussed to death here a couple of weeks ago.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
.



Relevant Pages