Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

(shockme) Re: More on Processing Command Line Arguments

by shockme (Chaplain)
on Oct 31, 2003 at 16:22 UTC ( #303587=note: print w/ replies, xml ) Need Help??


in reply to More on Processing Command Line Arguments

If you're wanting to ensure they only use one option, it seems the easiest would be to only allow one option. For example:
GetOptions( 'request|r=s' =>\$Request, 'man|m' =>\$Manual, 'help|h|?' =>\$Help ); if ($Request =~ /^list$/i) { # whatever } elsif ($Request =~ /^view$/i) { # whatever } # and so on

But I may be misunderstanding the issue. Not an uncommon event in my life.

If things get any worse, I'll have to ask you to stop helping me.


Comment on (shockme) Re: More on Processing Command Line Arguments
Download Code
Re: Re: More on Processing Command Line Arguments
by Ninthwave (Chaplain) on Oct 31, 2003 at 16:44 UTC

    What the script does is:

    1. Add a record to a database
    2. Edit a record from a database
    3. List the records in the database
    4. View a record from a database

    But you should only be able to do one option at a time. I would like to call that in the command line instead of having a menu system in the script itself.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (15)
As of 2014-09-18 13:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (116 votes), past polls