On Wednesday, January 9, 2002, at 06:57 PM, Charles Albrecht wrote:
> At 6:34 PM -0600 1/9/2002, Chris Devers wrote: >> >> I created that script by pasting from one Terminal window's email >> client >> to another's Vim editor, so the line endings got screwed up while >> passing >> through the system clipboard. Should OSX Perl be more tolerant of this >> sort of thing? Pasting isn't exactly an unusual operation... > > Terminal should be more clever with this. It's got an optional pref for > "Translate newlines to carriage returns when pasting," I'm not sure if > it would help in this case. I'm unable to get the same behavior > when pasting into vi, so it might be an issue with Vim - it may have > assumed you wanted things saved with CR instead of LF. Actually, > considering the fact that you got output from cat on separate lines, > rather than crammed onto one, vim may have saved it with CRLF. How is Terminal supposed to know what kind of line endings you want? I create lots of text files in both formats. I don't think the solution lies in fixing anything about Terminal. I think I agree with Chris, it would be nice if perl were a little more agnostic about line endings in its scripts. Actually, I think perhaps later perls already do this? I've heard of such a thing, anyway, but I'm not sure whether/when it's been done. -Ken