sub create_tables { my ($heading_flag, $game_no, %totals) = @_; if( %totals) { open( $out_file, '>', $obtain_321_file ) or die "G1 Open output file $obtain_321_file failed $!"; foreach $game_no (sort keys %totals) { foreach my $key (sort keys %{$totals{$game_no}}) { if (! $totals{$game_no} == 0) { print ($out_file "$totals{$game_no}{$key},$players{$key}\n"); } } } close ( $out_file ); calculate_overall_results(); close ( $out_file ); }