in reply to elsif failing
always start your script with
use strict; use warnings; [download]
Numbers are compared using == for strings you need eq