Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

(shockme) Re: More on Processing Command Line Arguments

by shockme (Chaplain)
on Oct 31, 2003 at 16:22 UTC ( [id://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.

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://303587]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-19 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found