Help for this page

Select Code to Download


  1. or download this
        return sub {
            my $r = rand();
            $r < $odds[ $_ ] and return $vals[ $_ ] for 0 .. $#odds;
        };
    
  2. or download this
    # return something that is going to come from ... 
    # ... an unnamed subroutine (unnamed ... 
    # ... because there's nothing between "sub" and "{"
    ...
            $r < $odds[ $_ ] and return $vals[ $_ ] for 0 .. $#odds;
    
        };