in reply to syntax issues

The statement:
if ($ispresent =='false') {
should employ the 'eq' string comparison operator rather than the '==' numeric comparison operator, like so:
if ($ispresent eq 'false') {
This is one of those little 'top-10-things-to-check-for' perl quirks.