in reply to if statement not working

Yeah Perl is different from the other languages I've worked with in that == is type-specific, use
eq - equal to ne - not equal to
for strings, as suggested above.