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

Re: [MacPerl] How to start perl scripts on a Mac?



At 09:28 -0700 98/09/24, d!rk caspary wrote:
> I'm new to McPerl. I started programmin Perl on an Linux system and want
> to
> ask if it is possible to start the perl script with a command line
>
> 	PerlScriptName.pl -file myfilename    (...) and other options
>
> e.g. using the MPW Shell.

Yes (when using the MPW shell and the MPW perl tool.  Just like Unix.
Almost.)
You can easily say
    perl PerlScriptName.pl -file myfilename ...

presuming perl is on your MPW command path.  The MPW perl tool installation
script ensures that the path is set up correctly.

to say
   PerlScriptName.pl -file myfilename    (...)
requires some special code at the beginning of the script.  See chapter 22,
p. 324 of the book "MacPerl: Power and Ease" or the html version of the
book at http://www.ptf.com/macperl/ptf_book/HTML/

The Mac OS, of course, does not have a command line.  However, you can
_drop_ files onto a MacPerl script droplet and treat these as you would any
other argument.

> Is also possible to start a perl script without running the perl
> interpreter seperately (as on Linux sytems you'll place your programm in
> $HOME/bin/ and use it)?

Your first example is an example of your second question.  But, yes.  Both
in MPW and standalone MacPerl.

(Actually, note that the interpreter _always_ runs separately on *nix, even
if the script is on your path; you just don't call it directly and don't
see it running. But it _is_ running.)

Under MPW perl, put the script on your command path and follow the
directions given in macPerl: Power and Ease as referenced above.

For the standalone MacPerl you can make a droplet (which looks and feels
like an application but needs the full MacPerl distribution available) or a
MacPerl runtime (which incorporates the required portions of MacPerl into
the runnable script "application".  Droplets and Runtimes are documented in
chapter 8, p. 122 of MacPerl: Power and Ease.
---
Vicki Brown, vlb@cfcl.com        |\      _,,,---,,_
Journeyman Sourceror      ZZZzz /,`.-'`'    -.  ;-;;,_
Scripts & Philtres             |,4-  ) )-,_. ,\ (  `'-'
http://www.cfcl.com/~vlb      '---''(_/--'  `-'\_)
P.O. Box 1269 San Bruno, CA  94066

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