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

Re: [MacPerl] setting perl directory & date



At 15.42 6/24/97, Wise Earth wrote:
>I'm a newbie to Perl and I'm currrently trying to convert Perl scripts from
>UNIX to Mac running Web*. Three questions:
>
>1.      If the perl address on UNIX is
>        #!/usr/local/bin/perl
>        what would be the comparabe address for my Mac server?

Simply put, "#!perl" is sufficient.


>2.      If the date address in the script on UNIX is
>        $datecom = `/bin/date`;
>        $date = `$datecom +"%r on %A, %B, %d, %Y, %Z`; chop($date);
>        what would be the comparable info on my Mac server?

Look into an external module, like Date::Format from CPAN.


>3.      If the perl address on UNIX is
>        $mailprog = `/usr/sbin/sendmail`;
>        what would be the comparable info on my Mac server?

There isn't one.

You really need to learn more about what Perl is and what your script is
doing on the Unix box.  This script is calling an external program --
sendmail -- and sending it information.  You don't have sendmail on your
Mac, and even if you did, you could not send it information over a command
line -- which is what backticks do -- since the Mac does not really have a
command line.

I am guessing the script is using sendmail to actually sendmail (it can be
used for other important purposes).  You will have to either send the mail
from Perl itself instead of sendmail (get libwww-perl from Paul Schinder's
page at http://mors.gsfc.nasa.gov/MacPerl.html) or send it via AppleEvents
or AppleScript to a mail program on your Mac.  Either way, it will have to
be done in a different manner.

--
Chris Nandor
http://pudge.net/
pudge@pobox.com



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