[thelist] Re: Perl scripts in Mac

Mike Combs mike at combsnet.com
Fri Feb 15 12:48:00 CST 2002


As others have said, BBEdit is absolutely the best way to go for a text
editor.  Among a million other things, it colors the syntax, which helps
debug/understand it.  And it only saves as a text file.  SimpleText can
embed pictures and formatting info which isn't going to work with you
upload the file.

It was also a big help to go into the File Exchange control panel and
configure files with a .pl, .pm and maybe .cgi extension to be associated
with BBEdit.  (Except for one, every CGI I've run across was written in
Perl, so it was really an ASCII file that I wanted to open in BBEdit.)

I used to use Fetch, but found that if I'm uploading a batch of files it
would often get screwed up about 10 files or so into the
process.  Vicomsoft FTP works more reliably and can synchronize
directories, too.

Whatever you use, it's important to download text files as ASCII.  This
automatically translates the special character(s) used to delimit end of
line (EOL) from the format on the Unix system into a Macintosh format, and
back again when you upload.  (I think Unix uses a LF for EOL, Macintosh
uses CR, and DOS uses CRLF.)  Save the files (from BBEdit or whatever
editor you use) as Macintosh files.  If you save as DOS, for example, then
upload as ASCII, the translation won't work (it'll try to translate CRLF
into LF, but won't find any CRLF).  ** any guru who wants to explain this
better, or correct me, jump in here **

Don't transfer text files in Binary mode unless you want to manually
remember to change the EOL format all the time.  This is very likely how
you got unrecognized characters into the file.

I don't remember anymore why I don't use MacPerl to edit my Perl
programs.  But I use MacPerl a lot to simply syntax check my Perl programs
before I upload them to my web host.  The error messages are clear and
point you to the offending lines of source code.  It's a must-have.

...mike




More information about the thelist mailing list