Command line arguments? 
Author Message
 Command line arguments?

I am trying to learn perl working through some problems from a book that I
am reading. One problem in the book is to read a file searching for words
that have characters specified from the commandline. I know how to implement
the problem for a finite set of commandline arg, but I am not sure how to
implement when the commandline can have 1 to many characters. Any
suggestions would be greatly appreciated.


Mon, 09 Feb 2004 21:47:40 GMT  
 Command line arguments?
Hmmm. Is your problem that you need to know how many arguments have been
typed at the command line?

If so, assuming you have them all split out into an array, you can get the

Or you could use a "foreach" statement on the array and iterate through them
that way.

Kevin


Quote:
> I am trying to learn perl working through some problems from a book that I
> am reading. One problem in the book is to read a file searching for words
> that have characters specified from the commandline. I know how to
implement
> the problem for a finite set of commandline arg, but I am not sure how to
> implement when the commandline can have 1 to many characters. Any
> suggestions would be greatly appreciated.



Tue, 10 Feb 2004 04:11:28 GMT  
 Command line arguments?

Quote:

>I am trying to learn perl working through some problems from a book that I
>am reading. One problem in the book is to read a file searching for words
>that have characters specified from the commandline. I know how to implement
>the problem for a finite set of commandline arg, but I am not sure how to
>implement when the commandline can have 1 to many characters. Any
>suggestions would be greatly appreciated.

perldoc Getopt::Long

--
Vorxion - Member of The Vortexa Elite



Tue, 10 Feb 2004 06:46:35 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help! with command line arguments

2. Command line arguments.

3. Simple reordering of command line arguments.

4. Passing form values back to a script as command line arguments

5. How to set varible from command line argument??

6. patch1 for wafeperl 0.2 to allow xt command line argument processing

7. Modification of command line arguments

8. Where are command line arguments described?

9. Command line arguments

10. escape characters within command line arguments

11. command line argument

12. Newbie ?: @ARGV not getting command line arguments

 

 
Powered by phpBB® Forum Software