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

Re: [MacPerl] How to mimic ARGV on UNIX



You can use MPW (free from Apple).
Save the following script as test.pl

-----------------------------------
Perl -Sx "{0}" {"Parameters"}; Exit

#!perl
print "$ARGV[0]\n";
print "$ARGV[1]\n";
print "$ARGV[2]\n";
--------------------------------------
Then you can run from MPW:
test.pl one two three 

See also the MPW chapter in the MacPerl Book:
(html-Version available)

http://www.ptf.com/macperl/ptf_book/


HTH,

Andreas Marcel



>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. That not a problem for me since I can access a korn shell by modem. But I  rather like try to mimic a perl script in MacPerl that is an executable on a UNIX box. 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?
>
>Thanks
>
>#!/local/bin/perl5
>
>print ("@ARGV[0]\n");
>print ("@ARGV[1]\n");
>print ("@ARGV[2]\n");
>
>Cheers
>
>-Emmanuel


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