It looks like you are just starting with Perl. One of the key features of Perl is that There Is More That One Way To Do It (TIMTOWTDI). Depending on the exact problem you are trying to solve, the solution may be different. However, given what little background you have specified in your post, one easy way to accomplish what you want is with the following one line
print MYFILE "abc, def\n" for (1 .. 100);
I rather suspect that your actual problem may be somewhat different, so please post any follow up questions here, after reading about How do I post a question effectively?