What exactly do you need help understanding? If you know what each line does, you just need to sit down with a piece of paper and start keeping track of what everything is (basically run the program yourself). If you don't know what a line does, there are some
for learning perl, or you can look it up in perldoc. Does that help you get started?