in reply to CGI problem

    "...the '==' has to be used for numeric and 'eq' in case of strings."

Yes, '==' for numeric, 'eq' for strings, and '=' for assignments.

Years ago, I learned a good trick for avoiding this kind of error:

if ($query_str='') { ... }
when, in fact, you meant to say:
if ($query_str == '') { ... }

If you get in the habit of always putting the constant on the left side of the '==' sign:

if ('' == $query_str) { ... }
then, if you accidentally drop one of the '=', you'll get an error:
if ('' = $query_str) { ... } # Produces: # Can't modify constant item in scalar assignment at line + 3, # near "$query_str) " # Execution of aborted due to compilation errors.
I don't usually make the mistake of writing '=' where I meant '==', but whenever I do, thanks to putting the constant on the left side, the compiler now let's me know about it in no uncertain terms!