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

Re: [MacPerl] compiling error



        

On Wed, 17 Apr 1996, Sadie O. McFarlane wrote:

> I've been wracking my brains for two days solid over this - hopefully
> someone can help!
> 
> I have NO experience with ANY Perl, I can see what the code is
> supposed to do but I don't know the details of exactly how to write it -
> and I'm frustrated beyond belief.  Can someone look at the first few lines
> of my code and tell me what is the problem?  I'll be forever indebted...
>

The solution's fairly obvious -- _if_ you know UNIX as well as MacOS. 
> 
> #!/usr/local/bin/perl
> #---------------
> #program for sending form results
> #------------
> 
> $mailprog = '/usr/lib/sendmail'
> 

It isn't specifically a perl problem; it's a UNIX-is-not-MacOS
problem. 

This program basically relies on an external UNIX program called
sendmail to send it's input out via email. sendmail doesn't exist
on the Mac. I'm also willing to bet that lower down in your program
there's a line that says something like:

open (SOMEHANDLE, "|$mailprog") | die ...


This type of construct (opening a pipe to an external program) doesn't
work on MacPerl, either.

You need to (a) read the "differences between Mac and UNIX perl" document
(wherever it is), and (b) find the SMTP module for MacPerl (which lets
you send email from a MacPerl program).

More to the point, if you're new to perl you really, _really_, want to
find a book that teaches you how to program in perl, rather than a book
that assumes you want to learn how to write HTML documents and can use
a UNIX web server with a perl interpreter in "cookbook mode".



-- Charlie Stross