On Thu, 6 Sep 2001, eric wang wrote:

> I am trying to take this optional parameter into my perl script.
> I use a hypen (-) to indicate that it's a parameter. However, how do i get
> rid of that hyphen? so for example:
> myexe -hello -world -1 when entered into my script it becomes
>
> just ARGV[0] = hello
> ARG[1]=world
> ARG[2]=1

You might want to take a look at Getopt::Long, which can handle
command-line options like this rather easily, and in a standard way, and
you don't need to worry about the dashes.

perldoc Getopt::Long

-- Brett
                                          http://www.chapelperilous.net/
------------------------------------------------------------------------
Your heart is pure, and your mind clear, and your soul devout.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to