Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
        }
        
    print "The high score was $high_score\n";
    
  2. or download this
    #!/usr/bin/perl
    
    ...
        }
        
    print "The high score was $high_score\n";
    
  3. or download this
    #!/usr/bin/perl
    
    ...
        }
        
    print "The high score was $high_score\n";
    
  4. or download this
    #!/usr/bin/perl
    
    ...
    sub last_score { $_[0]->{$_[1]}[-1]          }
    sub game_count { scalar @{ $_[0]->{$_[1]} }  }
    sub score_n    { $_[0]->{$_[1]}[ $_[2] - 1 ] }
    
  5. or download this
    #!/usr/bin/perl
    
    ...
        $sum += score_n( @_, $_ ) foreach ( 1 .. game_count( @_ ) );
        $sum;
        }
    
  6. or download this
    sub stats
        {                
        @{ $_[0] }{ qw(name sum average last) } = 
            ( $_[1], &sum, &average, &last_score );
        }
    
  7. or download this
    #!/usr/bin/perl
    
    ...
            
        \%hash;
        }
    
  8. or download this
    #!/usr/bin/perl
    
    ...
        }
    
    sub high_score { ... }
    
  9. or download this
    package Local::Scores;
    use DBM::Deep;
    ...
        }
    
    sub high_score { ... }
    
  10. or download this
    #!/usr/bin/perl
    
    ...
        {
        $modules->{$elem->[0]} = $elem->[1];
        }