The assignment to $result is dead and can be removed.
What about $value, if $resp[0] is not "FAIL", "ERROR" or "OK" ?