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

Re: [MacPerl] use of @ARGV in Unix/Mac



At 20.53 1998.04.25, Xah Lee wrote:
>Suppose I have a script "generateReport.pl" that takes in a date as
>argument and prints to STDOUT. e.g.
>
>[unix prompt]$ generateReport.pl 19980304
>
>Is it possbile to run this script on a mac without modifying it?
>
>Basically I'm writing scripts for unix, but need to code or test them on
>my mac.
>
>Thanks in advance.

Vicki came up with a good way that we worked out that does something like this:


@ARGV = MacPerl::Ask('ARGV?') if ($^O eq 'MacOS' && $MacPerl::Version !~ /MPW/);


This will, if running under MacPerl and not under the MPW tool, open a
dialog box asking you for the arguments.  It does require a slight
modification of the script you are using, but not a drastic one, and it
will continue to work just fine under any other platform.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==               New Book:  MacPerl: Power and Ease               ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#



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