in reply to Beginner issues!

You have a number of issues like $count ge 4 where you are using a string operator with numerical operands.

Check the Relational Operators and the Equality Operators in perlop.

-- Ken