in reply to Re^2: Dynamic option
in thread Dynamic option

Hi,is there a way to add options to option values?meaning ,in the below example the option is "input" and it's values are data,modem,apps but for these values I want to add options (-nd -na -nc)?Can someone pls advise how can I achieve that?

EXAMPLE:- findfiles -input [-nd -na ] data [-nc -nd] modem apps -des "finding fi +les" -r 1000 Basically ,pseudco code of what I want to achieve is below.Really appr +eciate if someone can give me the perlversion of the code. for each "input option value" { call function A if not exits nd call function B if not exits na call function C if not exists nc }

Replies are listed 'Best First'.
Re^4: Dynamic option
by ikegami (Patriarch) on Mar 16, 2011 at 06:19 UTC
    You'll need a different parser.

      OP should look into Getopt::Euclid. It will provide to specify optional "sub options", in terms of plain old strings. Based on presence of those strings, run the code as you would desire. I would guess one would access a sub option, for example, as $ARGV{-input}->{-nd}.

      I personally do not want to deal with G::Euclid due to much stuffing of POD.

      Can you suggest any other idea on how can I achieve it?any idea which parser can do that?perl cannot do that?

        There probably isn't an existing one. Your needs are unique. (Which should lead you to question them!)