Help for this page

Select Code to Download


  1. or download this
    # My memory of the gist of what's in the book, a few hours after havin
    +g looked it up:
    my $thing = do {
    ...
        elsif ($cond2) { "Bar" }
        else           { "Baz" }
    };
    
  2. or download this
    my $thing = do {
        ($cond1) ? "Foo" :
        ($cond2) ? "Bar" :
                   "Baz";
    };
    
  3. or download this
    my $thing = ($cond1) ? "Foo" : 
                ($cond2) ? "Bar" :
                           "Baz";
    
  4. or download this
    my $thing = do {
        my $rn = int(rand(6))+1;
    ...
        ($rn == 1) ? "Lousy Roll"        :
                     "Meh.";
    };
    
  5. or download this
    sub agent {
        my $self = shift;
    ...
            return Agent->new($agent_args);
        };
    }