in reply to Re^2: Problem with files read to array split on empty lines
in thread Problem with files read to array split on empty lines
How did you transfer them? FTP? Many FTP clients will choose to transfer some files (often using the file name as a hint as to whether it's appropriate) in "ASCII mode" which means that it will change the line to the standard line endings for the local system during transfer.
Try replacing your /\n{2,}/ regular expression with:
/(?:\r?\n|\r){2,}/
... which should match two or more occurrences of any common line ending.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Problem with files read to array split on empty lines
by jhoop (Acolyte) on Aug 03, 2012 at 19:12 UTC |