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

Re: [MacPerl] Newlines



At 11.31 10/12/97, Mark F. Murphy wrote:
>Am I misunderstanding something or do I have to convert all my existing
>perl files from Unix newlines to Mac carriage returns?
>
>MacPerl seems to not like a Unix based text file... it won't run the
>script.  However, if I use BBEdit and change it to Mac based it runs fine.
>
>Any suggestions?

Just what you said, convert it to Mac CR (\015) instead of UNIX LF (\012).  Most text editors do this, along with gobs of other utilities, and you can make a MacPerl droplet to do it as well:

#!perl
$/ = "\012";
$^I = ".orig";
while (<>) {
    s/\012/\015/g;
    print;
}


--
Chris Nandor             pudge@pobox.com             http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==            MacPerl:  Programming for the Rest of Us            ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#



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