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

Re:[MacPerl] <img src="cgi-bin/image.pl">



At 21.02 -0400 1998.10.21, David Ray wrote:
>You are missing binmode and the mime-header:
>binmode IMAGEFILE;

binmode() is a no-op on MacPerl.  It does nothing.

On DOSish systems, the value of newline changes depending on whether the
file is binary (\012) or ASCII (\015\012).  Socket communications are
treated as binary automatically.  The newline value is then used by the
special variable $/ (input record separator), which is used for operators
like <>.  So when reading in a binary file, you need to use binmode (well,
you don't need to, but it is the easiest way to deal with the problem).

In MacPerl, the value of newline never changes.  So while binmode() is a
Good Idea for a portable script, it is useless on a Mac- or Unix-only
script.

--
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 mac-perl-request@iis.ee.ethz.ch