]> git.sesse.net Git - remoteglot-book/commitdiff
Minor fixes to the Perl frontend.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 8 Jun 2017 07:27:53 +0000 (09:27 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 8 Jun 2017 07:27:53 +0000 (09:27 +0200)
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;