Question 5: Behind the scenes
#!/usr/bin/perl use 5.014; use strict; use warnings; use autodie; open my $fh, '<', '4names.txt'; my $i = 1; while(my $name = <$fh>) { chomp($name); my $filename = sprintf('contestants/contestant%02u', $i++); open my $out, '>', $filename; say $out "Name=$name"; foreach my $j (1..100) { my $choice = [qw(rock paper scissors)]->[rand(3)]; say $out $choice; } }