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

Re: [MacPerl] Command-line arguments with MacPerl 5.0.7



At 8:05 12/16/96, Philippe de Rochambeau wrote:
>How do you simulate multi-command-line arguments with MacPerl; e.g.,
>myperlpgm.pl myfirstarg mysecondarg ..., where myfirstarg is a file and
>mysecondarg is a text parameter?

You can preface the script with a line like this:

#!perl
@ARGV = ('myfirstarg','mysecondarg');


#================================================================
perl -e 'srand();if(rand>.5){$i=0;foreach(@ARGV){@$i=split(//);$z
[$i]=0;foreach(@$i){$s[$i][$z[$i]]=$_;$z[$i]++;}$i++;}foreach(@s)
{foreach(@$_) {print}print" ";$_++}}else{print(join(" ", @ARGV))}
print"\n"' McClellan Clan Motto: Think On

Chris Nandor                                      pudge@pobox.com
PGP Key 0xB76E72AD                              http://pudge.net/