is this a working highscore perl script?

    #!C:\Perl\bin\perl
    use strict;
    use CGI;
    use DBI;
    # Read form data etc.
    my $cgi = new CGI;
    # The results from the high score script will be in plain text
    print $cgi->header("text/plain");
    my $playerName = $cgi->param('playerName');
    my $score = $cgi->param('score');
    # Connect to a database
    my $dbh = DBI->connect( 'DBI:mysql:####', '####', '####' )
        || die "Could not connect to database: $DBI::errstr";
    # Insert the player score if there are any
    if( $playerName  $score) {
        $dbh->do( "insert into scores (Player, Score) values(?,?)",
            undef, $playerName, $score );
    }
    # Fetch the high scores
    my $sth = $dbh->prepare(
        'SELECT player, score FROM scores ORDER BY score desc LIMIT 10' );
    $sth->execute($Player);
    while (my $r = $sth->fetchrow_arrayref) {
        print join(':',@$r),"\n"
    }

need a working one without using a pointless game variable

Looks fine to me but what “game variable” are you referring to?

Also, this isn’t the place to ask for Perl advice.