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

Re: [MacPerl] MacPerl and BinHex



There are several problems which you have to deal with when downloading
text files from the net.  The first is that Carriage Returns (CRs) and
Linefeeds (LFs) can be included in the file.  Since the Mac only needs
the CRs, the LFs cause problems.  Another problem which people run into
all of the time is the difference of downloading a file as a binary file
instead of as a text file.  It is easy to do since various people use
various endings on the files and this can cause Netscape and Explorer to
use alternative methods to transfer the files.

One of the easiest things to do in MacPerl, when you've downloaded a
binhex file, is to have it compare how long each line is.  Each line of
a binhex file should be exactly the same length.  I believe the number
of characters should be 80 per line - but you would have to check that. 
If any of the lines are of a different length (except the last one) then
you have a problem.

You can also use MacPerl to check the line endings.  The easiest way to
do this is to just use the CHOMP command, let it get rid of any
extraneous control characters at the end of the line, and then just
write everything out with the "\n" character string.

The last thing which you can do to help insure things are well with the
binhex file is to use MacPerl to check for leading text information. 
There should be nothing before the start of the binhex information.  If
there is - it can cause problems.

Just a few notes.  :-)

--------------------------------------------------------------------------------
All e-mail needs to be sent to mark@cheers.jsc.nasa.gov.  If you don't,
it will
probably bounce.  What man does not understand or fears; he ultimately
destroys.
Steve Wright: Black holes are where God divided by zero.

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