Here is a more readable version with comment. I now include speaker order and made the output a little more readable. The problem pointed out by Chromatic is also fixed in this version
#!/usr/bin/perl
# the folllowing check your code for you
# enforce some good behaviour (like declaring variables)
# and catch a lot of finger pilotage errors
use warnings;
use strict;
# here I declare some variables I am going to use
# $ is a scalar (string, number, or a reference to another variable)
# @ is an array of scalars
# % is an associative array or hash, values looked up by a unique key
my ( $case_number,
$head_count,
@player,
$spoke_first,
%player_said,
$round
);
Cheers, R.
Pereant, qui ante nos nostra dixerunt!
|