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 $key (sort sortvalue (keys(%totals))) { if (! $totals{$key} == 0) { print ($out_file "$totals{$key},$players{$key}\n"); } } close ( $out_file ); calculate_overall_results(); close ( $out_file ); }