in reply to why isn't split() working here?
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: why isn't split() working here?
by JavaFan (Canon) on Dec 09, 2010 at 09:59 UTC | |
Re^2: why isn't split() working here?
by 7stud (Deacon) on Dec 09, 2010 at 03:42 UTC | |
by ikegami (Patriarch) on Dec 09, 2010 at 04:35 UTC | |
by Anonymous Monk on Dec 09, 2010 at 07:11 UTC | |
by ikegami (Patriarch) on Dec 09, 2010 at 16:08 UTC | |
by Anonyrnous Monk (Hermit) on Dec 09, 2010 at 04:18 UTC |
In Section
Seekers of Perl Wisdom