in reply to cheesy comparison program not working!!

Add use strict; use warnings; on line 2 of your script, and you'll get a hint of what's wrong:
Scalar value @greater[n] better written as $greater[n] at line 30. Possible unintended interpolation of @greater in string at line 39. Bareword "n" not allowed while "strict subs" in use at line 30.