Getopt:Long arguments that are not (options or option values) 
Author Message
 Getopt:Long arguments that are not (options or option values)

Hi Group.
I use Perl "use Getopt::Long;" .
Now, I know how to get command line options and their values.
But I want to get into a Perl array all the command line arguments
that are NOT options and NOT values.

For example:

./myscript.pl -f option_val_of_f -g option_val_of_g   arg1 arg2 arg3

I would like to get a Perl array with arg1,arg2,arg3  .

Do you know how to do such stuff?

Thanks,
NAHUM



Sat, 09 Mar 2013 18:33:17 GMT  
 Getopt:Long arguments that are not (options or option values)

Quote:
> Hi Group.
> I use Perl "use Getopt::Long;" .
> Now, I know how to get command line options and their values.
> But I want to get into a Perl array all the command line arguments
> that are NOT options and NOT values.

> For example:

> ./myscript.pl -f option_val_of_f -g option_val_of_g   arg1 arg2 arg3

> I would like to get a Perl array with arg1,arg2,arg3  .


Wolf



Sat, 09 Mar 2013 18:58:18 GMT  
 Getopt:Long arguments that are not (options or option values)

Quote:
> I use Perl "use Getopt::Long;" .
> Now, I know how to get command line options and their values.
> But I want to get into a Perl array all the command line arguments
> that are NOT options and NOT values.

> For example:

> ./myscript.pl -f option_val_of_f -g option_val_of_g ? arg1 arg2 arg3

> I would like to get a Perl array with arg1,arg2,arg3 ?.



array, leaving only the non-option-arguments behind.


you call GetOptions()).

   I hope this helps, Nahum.

   -- Jean-Luc



Sat, 09 Mar 2013 18:59:18 GMT  
 Getopt:Long arguments that are not (options or option values)

Quote:

> Now, I know how to get command line options and their values.
> But I want to get into a Perl array all the command line arguments
> that are NOT options and NOT values.

Read the documentation for the module and look for the 'pass_through'
configuration option.

//Makholm



Sat, 09 Mar 2013 19:28:28 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Problem checking if a command line option has been specified using Getopt::Long

2. ANNOUNCE: Getopt::Long 2.9 -- Universal command line options processing

3. ANNOUNCE: Getopt::Long 2.6 -- Universal command line options processing

4. Using Getopt::Long with multiple options in quotes

5. Getopt::Long and Options in single quotes?

6. Getopt::Long, using '?' as option

7. GetOpt::Long - Corequisite options?

8. ANNOUNCE: Getopt::Long 2.9 -- Universal command line options processing

9. ANNOUNCE: Getopt::Long 2.6 -- Universal command line options processing

10. Getopt::Long need a '-?' option

11. Tk-Options-0.10: Interface to Getopt::Long and Tk

12. getopts::long & option string argument

 

 
Powered by phpBB® Forum Software