On Thursday, May 2, 2002, at 12:32 , Josef E. Galea wrote:

> How can I pass parameters (eg: a file name) to a Perl script


you will ultimately want to deal with

        perldoc GetOpt::Long

as the complexity of the command line argument sequence grows.

given something like:

    #!/usr/bin/perl -w
     use strict;

     # argvWalker.pl- is for

     my $count=0;
     foreach my $arg (@ARGV) {
         print "\t($count) :$arg: \n";
         $count++;
     }

     # end of the world as I knew it [EMAIL PROTECTED] all rights reserved
     # ginned On 3-May-02
     #

you will get output like:

        ./argv* -a --b c d
         (0) :-a:
         (1) :--b:
         (2) :c:
         (3) :d:

hence you can either walk each file through inside the foreach
loop - and then go on - or - like what ever...

ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to