Re: need help with loops
- --- In firstname.lastname@example.org, "ouretski_leonid"
> Hello thereI *think* you want to look at the @ARGV list.
> If someone could help me with the following problem, it would be
> greately appriciated.
> The problem:
> - i have a program, which runs from DOS (eg. Program1)
> - the command to run the program can have a number of different
> arguments (eg. arg1, arg2, arg3, arg4)
> - examples of the DOS entry:
> Program1 -arg1 -arg2
> Program1 -arg1
> Program1 -arg1 -arg3
> Need to:
> - have a Perl code, that would generate a list of all possible DOS
> Hopefully above makes sence. I'll try to provide better explanation
> if needed.
You can use the Getopts::Long module to parse the 'DOS entries' (which
I would call 'command line arguments or switches') easily.
Add the following line to your code:
print "Arguments:\n", join( "\n", @ARGV );