To directly answer your question, your code doesn't do anything with the $win or $loss variables. You've defined a subroutine (called hf1) that's supposed to print out a form that records them, but it doesn't get called anywhere.
I'd have a few more general tips for you also:
- Indenting your code properly makes it much easier to read: for yourself, for anyone you collaborate with and also for us on forums who are trying to read it
- When you try printing to the roll.txt file, you forgot to print to the DATA filehandle.
- You don't declare any of your variables. In its default mode, perl will allow this, but it's bad practice. If you acidentally used variables called $froll1 and $frol11, they'd look very similar with many fonts, but they're totally different variables. A very hard bug to track down in larger programs.
- You can ask perl to force you to get into good habits by adding "use strict;" and "use warnings;" to the top of your program (just after the first line would be a good place).
- You're using the CGI module for some things but not others: better to be consistent (e.g. print header()).
- You've defined a subroutine in the middle of your code. Another thing that makes it harder to figure out what's going on. Generally, put subroutines in their own section at the end.
- You're printing the end of the HTML document (end_html) before the middle!
- There's a section in the middle that doesn't do anything! $dice1>=3; etc.
That's probably enough for now