my $successes = 0; foreach my $trial (1..$number_of_trials) { roll_dice(); if (any_matches()) { $successes = $successes + 1 } } print "Number of successes: ", $successes, "\n";
sub print_matches { my (@matches) = @_; foreach my $match (@matches) { print $match, "\n"; } }
There is a second hint if you need it.