Help for this page

Select Code to Download


  1. or download this
    my %dispatch = ( 
        DoThis => sub { print "You asked me to do this.\n"; },
        DoThat => sub { print "You asked me to do that.\n"; }
    );
    
  2. or download this
    SWITCH: for ( @commands ) {
        m/^This/ && do { print "You asked me to do this.\n";
    ...
    sub Another_Way {
        print "You asked me to do it another way.\n";
    }