Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Dynamic option

by Anonymous Monk
on Mar 16, 2011 at 05:31 UTC ( [id://893497]=note: print w/replies, xml ) Need Help??


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!)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://893497]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-04-19 06:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found