http://qs321.pair.com?node_id=876158


in reply to why isn't split() working here?

7stud:

If you set $whole_file = "aaa\nbbb\nccc\nxxx\nyyy\xzzz"; in your first example, you'll see that it works there, too. I'd guess that you're on a windows box and your DATA section actually looks like: "aaa\r\nbbb\r\nccc\r\nxxx\r\nyyy\r\nzzz\r\n". If that's true, then changing your split expression to /xxx\r?\n/ or /xxx[\r\n]+/ might save the day for you.

...roboticus

When your only tool is a hammer, all problems look like your thumb.