or download this
# Pull out the numbers of the checkboxes that were selected.
# e.g. If box1, box3 and box12 were selected, @selected = (1, 3, 12)
...
open FH, ">$filename" or die "Can't write to $filename, $!";
print FH @posts or die "Couldn't write to file, $!";
close FH or die "Can't close file etc, $!";