He's right -- take out that and it works just fine for me. And if I put a linebreak at the end of $string that works too.
Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.
M-J D | [reply] |
His sample data looks like it has newlines. Did you test yours with a newline in the data? It should work fine (for some definition of "fine") if the data contains one.
This may well be the problem. He may be removing the newline, for instance. But, as given, there isn't error at all. The code works.
-sauoq
"My two cents aren't worth a dime.";
| [reply] |
I'm wondering if maybe it's the last chicken in the shop, I mean, the last line in a block, and that \n should be (\n|\z), i.e. "a newline or the end of the file". I got caught by that one recently...
Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.
M-J D
| [reply] |