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:
    ...
    }