[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Reading PC files





William B. Birkett wrote:
The difference between these files is

> that the Mac uses a CR as a line ending, whereas the PC uses a CR followed
> by a LF.
>
> I have opened PC files in BBedit, and re-saved them with Mac line endings,
> and they process fine.
>
> Is there a way to configure MacPerl to handle PC files?

couldn't you just tell macperl to remove the pc file's LF when you open it

ie
open (INFILE,"<$file");
while (<INFILE>);
$_ =~ s/\r(.*?)$/\r/g;
close INFILE;




im not sure the CR is a '\r', but you could get a binary viewer or something
and search and replace the octal equivalent.

>
>


--
Its reassuring to know that if you behave strangely enough, society will take
full responsibility for you.



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch