in reply to question about "split" function

If you don't want to be hassled by line endings (Mac / Win / Unix) you might try:

split /[\r\n]+/, $x;
So it'll handle a set of carriage returns and newlines no matter which order they appear in. Do note, however, that if you want to preserve information on blank lines, that this won't work. It'll happily gobble up sequential end-of-line sequences...

...roboticus