No programmer I've ever known of is able to consistently create perfect programs. So don't feel bad if you also have some problems you need to solve. I've spent many hours looking for a missing closing bracket or a misspelled variable name. Syntax errors are made as you type your script into an editor. For example, you might not add a closing quote or might misspell a filename.
Logic errors are more insidious and difficult to find.
For example, you might place an assignment statement inside an if statement block that belongs outside the block. Or you might have a loop that runs from 0 to 100 when it should run from 10 to 100. Accidentally deleting the 1 or not entering it in the first place is very easy. Syntax errors are usually easy to fix. You'll see how to decipher some of Perl's error messages.