Help for this page
open (CASEFILE, ">$whichfile");
# better: open CASEFILE, '>', $whichfile or die "Can't write '$whichfile': $!\ +n";