in reply to Shouldn't this return the named checkbox's value?

I believe this snippet
next if ( $q->param("box$ post_number") );
Should cycle through my checkboxes and return their values ...
next works best within a looping construct. Your snippet doesn't have one. $post_number stays undef.

Likewise, $_ never gets a value. That's why you're getting zero bytes when you write $_ into a newly-created file.

You need to start with $post_number = 1, and count up until you don't find any valid parameters named "box$post_number", AND you need to grab valid parameters and stick them into $_.