Help for this page

Select Code to Download


  1. or download this
    sub ksh_select(&@) {
      my $cr = shift;
    ...
        $cr->( $_ );
      }
    }
    
  2. or download this
    ksh_select { print "You chose $_\n" } qw( foo bar quux );
    
  3. or download this
    # in this example, the user has choices to navigate around some struct
    +ure.
    my %dispatch = (
    ...
        ? $dispatch{$menu[$_]}->()
        : warn "Selection out of range!\n";
    } @menu;