in reply to file creating AND writing error

You're not telling Perl to output data to the file you've opened.

Try changing

printf "%3s", $ser;
to
printf CREATE "%3s", $ser;
Notice the difference: the second printf statement makes use of the CREATE filehandle you've opened your file under. This instructs Perl to redirect printf's output there.

Hope that helps,