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