Expanding on what Perlbotics had to say, perl's error messages are very helpfull once you have some experience of them. Until you reach that point in your Perl development, the diagnostics pragma can help you understand exactly what perl is complaining about.
It's easy to use, just start all your programs with