I have a script which I want to start from the command line.
Following are examples how I would probably start it..
1. myscript.pl -5
- accept only numeric input
2. myscript.pl /pathname
- give a pathname, if no pathname then it default to
current directory
- path can be absolute or relative
3. myscript.pl path1 /path2
- give more than 1 pathname, it should be able to accept
N path...
- path can be absolute or relative
4. myscript.pl -5 path1 /path2
- combination of inputs...
how can I go about accepting the inputs and doing some
form of validations?
thanks
-
Following are examples how I would probably start it..
1. myscript.pl -5
- accept only numeric input
2. myscript.pl /pathname
- give a pathname, if no pathname then it default to
current directory
- path can be absolute or relative
3. myscript.pl path1 /path2
- give more than 1 pathname, it should be able to accept
N path...
- path can be absolute or relative
4. myscript.pl -5 path1 /path2
- combination of inputs...
how can I go about accepting the inputs and doing some
form of validations?
thanks
-