First, "if" should not be capitalized. Next, parens will help. Thirdly, use "==" ">" rather than "gt" for numeric comparison. (I think only the first point is mandatory; Perl is probably trying to interpret "If" as some sort of function call.)
Apart from that, try formatting for legibility -- sensible and regular indents, breaking up long lines, and so on. It really cut down on the amount of time spent fixing things.