in reply to parsing arguments

Your life may be easier with the core module, Getopt::Long.

It's well documented, and saves you from the pitfalls of trying to parse a complex command line yourself.

In particular read the section in Getopt::Long's documentation about "Options with hash values". And the "Summary of Option Specifications".

UPDATE: Since Getopt::Long prefers command line arguments to look like "--option=value", if it is deemed that using Getopt::Long is enough of an advantage to be worth using, you could consider the additional step of setting up a BEGIN{} block that preprocesses the command line arguments to make them look like options so that Getopts::Long can still conveniently put them into a hash for you.


Dave


"If I had my life to do over again, I'd be a plumber." -- Albert Einstein

Replies are listed 'Best First'.
Re: Re: parsing arguments
by mifflin (Curate) on Oct 07, 2003 at 22:47 UTC
    I hear ya but this argument style I have to live with.
    It is the argument style that is used in Oracle's old 1.1 version of is report writer.
    I'm trying to port our existing ksh scripts to call instead the new rwservlet that needs the parameters in an http GET or POST form parameters.
    For the period of the pilot, however long that will be, I will need to have the same calls execute the old and new versions of the report.
Re: Re: parsing arguments
by BUU (Prior) on Oct 07, 2003 at 22:43 UTC
    Um, Getopt::Long handles command lines that look like "--option value" and so on. That really has very little do with what he's attempting, other then a superficial resemblance.