T
Tim Shoppa
I've found that the code fragment
my @p = split ".",$s;
doesn't behave as I would expect it.
For example:
print (join "\n",(split ".","some.text.with.dots.in.between"));
produces no output, and this
print scalar split(".","some.text.with.dots.in.between");
gives me a fat 0. If I replace all the dots with commas or other
"ordinary" characters then it works like I expect.
Now, when I do read the documentation on split it mentions that
split " " works like awk, throwing away leading and trailing spaces
and otherwise matching on /\s+/. But that's not my case.
I suspect that split is special-casing the "." into some special-
purpose pattern but I cannot find documentation on what it is doing.
Can anyone point me in the right direction?
This is perl 5.8.2, if it matters. (Same thing when I go back to 5.6.0,
as far as I can tell.)
Tim.
my @p = split ".",$s;
doesn't behave as I would expect it.
For example:
print (join "\n",(split ".","some.text.with.dots.in.between"));
produces no output, and this
print scalar split(".","some.text.with.dots.in.between");
gives me a fat 0. If I replace all the dots with commas or other
"ordinary" characters then it works like I expect.
Now, when I do read the documentation on split it mentions that
split " " works like awk, throwing away leading and trailing spaces
and otherwise matching on /\s+/. But that's not my case.
I suspect that split is special-casing the "." into some special-
purpose pattern but I cannot find documentation on what it is doing.
Can anyone point me in the right direction?
This is perl 5.8.2, if it matters. (Same thing when I go back to 5.6.0,
as far as I can tell.)
Tim.