in reply to New Perl user - help with my homework

I'll not comment on the errors in the algorithm - after all, it's your homework and not mine. So, here are some Perl tips: