At 07.54 -0700 1999.11.22, Tom Christiansen wrote: >>The suggestion that I heard which I most like is letting $/ be an RE. So >>you can make $/ be /\n|\r\n?/ and it magically "does the right thing" on >>virtually any file. However integrating this logic into the RE engine >>could be interesting. After all if you apply the pattern I gave to a >>string that ends with \r, it will match even if the next character to be >>read is \n. This is manifestly not the right thing to do. :-( > >Anything that deviates from the notion of internally representing the >line terminator as a single character (the virtual "\n") is a grave error. I had another idea ... which maybe completely useless, but it is interesting to think about. If $/ is a regex, then it is only a regex until it matches the first time, at which point $/ becomes equal to $1. So: $/ = qr/(\015?\012|\015)/; As soon as it sees \015\012, \012, or \015, $/ becomes whatever it matched. Again, this would require per-filehandle IRS to be useful. Not advocating, just throwing it out for fun. :D -- Chris Nandor mailto:pudge@pobox.com http://pudge.net/ %PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])Thread Previous | Thread Next