Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^2: Dynamic option

by Anonymous Monk
on Mar 16, 2011 at 03:57 UTC ( #893489=note: print w/replies, xml ) Need Help??

in reply to Re: Dynamic option
in thread Dynamic option

Thanks but my problem is on how to access these options?.I want to run a for loop for all the options entered <code>

Replies are listed 'Best First'.
Re^3: Dynamic option
by ikegami (Patriarch) on Mar 16, 2011 at 06:15 UTC
Re^3: Dynamic option
by Anonymous Monk on Mar 16, 2011 at 05:31 UTC

    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 }
      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?

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2023-09-24 02:36 GMT
Find Nodes?
    Voting Booth?

    No recent polls found