Re: Using Getopt::Std

2004-01-13 Thread Hacksaw
> > > > Hi, > > i am using the Getopt::Std package in my code. > > > > > > use Getopt::Std; > > > > getopts('s:'); > > > > $a = $opt_s By the way, you don't really need to assign the $opt_x variables to a new variable. $opt_s will be persistant, unless you run getopt again, which would b

Re: Using Getopt::Std

2004-01-13 Thread William.Ampeh
Put quotes around your arguments. Use single quotes if you are not doing variable substitution, and double quotes if otherwise. That is: my_program.pl -s 'will[1]' "$will" __ William Ampeh (x3939) Federal Reserve Board -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

Re: Using Getopt::Std

2004-01-13 Thread Wiggins d Anconia
> Hi, > i am using the Getopt::Std package in my code. > > > use Getopt::Std; > > getopts('s:'); > > $a = $opt_s > > > this is how i run my program from command line " > > > my_program.pl -s pattern > > now if "pattern" is something like abcd[12] how do i > make my program accept the in

Using Getopt::Std

2004-01-13 Thread Perl
Hi, i am using the Getopt::Std package in my code. use Getopt::Std; getopts('s:'); $a = $opt_s this is how i run my program from command line " > my_program.pl -s pattern now if "pattern" is something like abcd[12] how do i make my program accept the index 12 as a part of the string for o

Re: Using getopt::std return hash with value of 1 rather than argument

2001-07-05 Thread Craig Moynes/Markham/IBM
>The perldoc for getopt::std states: >Hash keys will be x (where x is the switch name) with key >values the value of the argument or 1 if no argument is >specified This is true for getopt, but not getopts. Getopts puts the parameter in the hash table (I am working on 5.005_03 built for aix ) per

Using getopt::std return hash with value of 1 rather than argument

2001-07-05 Thread charles
> Clean this up as: > if ($option{n}) { > $domain = $option{n} > add(); > } > > Don't use ARGV once you have used getopt (or getopts). The hash you > specify to the option getter > creates the keys as the flags and the values as the associated parameter. > > #if -f, then set $path > if