http://www.perlmonks.org?node_id=873579


in reply to Re^2: Parsing command line options without knowing what they are
in thread Parsing command line options without knowing what they are

maybe Getopt::Regex?, and use a catch all regex with a sub to process each argument, e.g. store in hash or array.
the hardest line to type correctly is: stty erase ^H
  • Comment on Re^3: Parsing command line options without knowing what they are

Replies are listed 'Best First'.
Re^4: Parsing command line options without knowing what they are
by DrWhy (Chaplain) on Nov 25, 2010 at 19:31 UTC
    I looked at this module last night and it's interesting, but it's too generic. I'd have to write too much of my own code to make this work, which is what I was hoping to avoid. I started poking around in Getopts::* on CPAN and did find a module that comes close to what I want, but not quite: Getopt::Casual.

    This module just parses a command line pulling out anything that looks like an option/switch/flag/whatever and uses some heuristics to decide if the following argument should be considered a value for that option/switch/... or not. Unfortunately one of those heuristics is exactly the opposite of what I want, so I think I'll give up and write my own code for this.

    --DrWhy

    "If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."