in reply to checkbox name processing

A quick note: you should quote all the attributes in your HTML tags. To do this, you will need to use some other quoting mechanism besides a double quote ("). Here is one way:

print qq[<input type="checkbox" name="$filename" value="1">\n];
Note the newline addition to make the source code more readable after the HTML page is output. I would also switch the order of the print and the open statment, so that if the open fails and the program dies, the line is not printed first.