in reply to syntax error near else and }

Problems:

I recommend that you check to see if your code is on par with the other students in your class. If not then you might try and reread whatever material you were given. If it is look ahead in your materials to see if, near the end of the course, you will be expected to write terse, readable, working code. If not, consider leaving the class and getting your money back. Your time and money would be far better invested in a good book. There are recommendations available at Perl.com.

Celebrate Intellectual Diversity