]> git.sesse.net Git - remoteglot-book/blobdiff - www/opening-stats.pl
Minor fixes to the Perl frontend.
[remoteglot-book] / www / opening-stats.pl
index f13e0a83523a358b679ebfd9678f94b8aa68d5aa..a88b0a28b1ad3d28cdb7f9fbd43290711a94113e 100755 (executable)
@@ -48,6 +48,9 @@ eval {
        $root_game->{'eco'} = $pgn->eco;
        $root_game->{'moves'} = int(((scalar @{$pgn->moves}) + 1) / 2);
 };
+if ($@) {
+       print STDERR "Error while getting root move: $@\n";
+}
 
 # Explore one move out.
 my $white_left = $json_root_pos->{'white'};
@@ -128,6 +131,7 @@ sub read_root_pgn {
                or die "../pgnnames.txt: $!";
        while (<$pgnnamesfh>) {
                chomp;
+               s/^comp://;
                push @pgnnames, $_;
        }
        close $pgnnamesfh;