in reply to File I/O question

You need an empty line between the last header and the content. And of course, you need a line end after the content type header. BTW: You should not use \n for network linefeeds, but \015\012. The former depends on the O/S, the latter doesn't, it always generates the required byte sequence. (\n works most of the time, because most servers are quite tolerant.)

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^2: File I/O question
by ikegami (Patriarch) on Jul 07, 2009 at 17:31 UTC

    Discounting an obsolete build of Perl on an obsolete version of Mac, there's no OS dependency. The only difference is whether the :crlf I/O layer is used or not.

    The :crlf layer is used by default on Windows and in environments where it appears in $ENV{PERLIO}. Overriding the default PerlIO layers can avoid it, and the one-argument call to binmode disables it.

    With :crlf IO layer absent or disabled
    MacPerl*Everything else
    \nCRLF
    \rLFCR
    \012LFLF
    \015CRCR
    \015\012CR LFCR LF
    With :crlf IO layer present and enabled
    MacPerl*Everything else
    \nN/ACR LF
    \rN/ACR
    \012N/ACR LF
    \015N/ACR
    \015\012N/ACR CR LF

    MacPerl is an obsolete build of Perl for obsolete Macs. It predates PerlIO.

Re^2: File I/O question
by sierpinski (Chaplain) on Jul 07, 2009 at 17:14 UTC
    Alexander,

    Thanks a lot, that did the trick. And thanks for the tip about the linefeeds. We are an all-Solaris shop for now, but you never know what upper management will decide when it comes to messing with our environment.

    Thanks!
      a better way to send mail is to use sendmail directly
      if you are on linux you can dosudo apt-get xmail and then use the following perl script
      use Mail::Mailer; $mailer=Mail::Mailer->new("sendmail"); $mailer->open ({ From=> <from address here>, To=> <to address here>, Subject=> <subject here>, }) or die "cant open mailer\n"; $body=<>; print $mailer $body; $mailer->close();
      the "sendmail" is to be replaced with the mail program like xmail (i use xmail)
      --------------------------------------------------------
      i'am worst at what do best and for this gift i fell blessed...
      i found it hard it's hard to find well whatever
      NEVERMIND