in reply to how can I learn well
Remember that some things really are hard to learn! One of his managers had a doctorate in astrophysics from Caltech; when he hit something that was hard and made him feel as if maybe he wasn't smart, he said to himself, "Wait, I have a doctorate in astrophysics from Caltech. I'm not stupid - this is hard."
Everyone hits stuff that is hard in the process of learning something new - there are a lot of new things in Perl, and some of them will seem more difficult to understand than others.
Make sure you get enough sleep - you really need 10 hours a night when you're working hard to learn something new (and coffee != sleep). You are clever enough; it just takes time to learn.