Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

consolidating menu option processing

by temporal (Pilgrim)
on Jul 19, 2013 at 02:14 UTC ( [id://1045238]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # simple menu/input collection
    enter word: foo
    you entered <foo>
    enter word: q
    quitting...
    
  2. or download this
    sub check_input {
        my $input = shift;
    ...
            print 'not recognized';
        }
    }
    
  3. or download this
    sub check_input {
        my ($type, $input) = @_;
    ...
        }
        # etc, etc
    }
    
  4. or download this
    while(1) {
        my $input = <>;
    ...
    if ($input eq 'b') {
        goto BREAK:
    }
    
  5. or download this
    my @working = (1 .. 10);
    # globally scoped anonymous coderef
    ...
    if ($input eq 'p') {
        $pop->();
    }
    
  6. or download this
    sub check_input {
        my ($input, $opts_href) = @_;
    ...
    SOMESPOT:
    ...
    }
    

Log In?
Username:
Password:

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

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

    No recent polls found