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

Re: [MacPerl] How to mimic ARGV on UNIX



At 10:50 -0700 1998/05/09, Emmanuel. M. Decarie wrote:
>I'm in the process of learning Perl from a book that give a lot of examples
>that will succeed only on a UNIX box.

Maybe; some may be more portable than you might think :-)

>Suppose I have the following script and its called "testARGV.pl". How can I do
>the same in MacPerl ? How can I pass arguments to it?

At 08:04 -0700 1998/05/10, riechert@miyako.japanologie.kultur.uni-tuebingen.de
(Andreas M wrote:
>You can use MPW (free from Apple).
>Save the following script as test.pl

True... Alternatively, save the MacPerl script as a droplet and then drop files
and/or folders on it. As has been commented before, you'll get back the full
pathnames of these files/folders; you may need to strip off the path if you
plan to treat them as anything other than files and folders (i.e. the name of
the argument is the important thing, not the contents.)

You'll also save the 44 MB disk space and (shall we say) interesting learning
curve of MPW :-)

MacPerl: Power and Ease (aka The Book) has a discussion of @ARGV, by the way
;-)  It includes some code that brings up a dialog asking for file names if you
don't happen to drop any.  Chapter 8, p. 123.

- Vicki

---
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