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

Re: [MacPerl] carriage return problems in scripts



At 9.06 +0000 2000.03.19, Nicholas Horwood wrote:
>How do i remove the carriage returns in perl scripts that have been saved as
>Macperl cgi, but that have unix <cr>
>(I get an error:# Illegal character \012 (carriage return).
>File 'grosbobo:webstar:calendar:calendar.cgi'; Line 1
># (Maybe you didn't strip carriage returns after a network transfer?)
>
>and sure enough, horrible <cr> at the begining of every line
>
>any suggestions?

It is not actually a carriage return (\015), but a linefeed (\012). 
MacPerl expects scripts with \015 as the newline.  Unix uses \012, 
and Windows uses \015\012.

>The script is on a Mac accessed via VNC (slow connection) from a PC. Uploaded
>using LeechFTP

You need to transfer the file as text to the Mac, so the newlines 
will be properly translated; either that, or store it as a "binary" 
file on the PC with \015 (CR) as the newline character.

See perlport for more info.

   http://www.perl.com/CPAN-local/doc/manual/html/pod/perlport.html#Newlines

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org