from your example:
if ($network == Whateverreally && *Something isin $awaymsg)
is not coded right the tests each need ()'s so:

if ( ($network == Whateverreally) && (*Something isin $awaymsg) )......


Help others! It makes the world a better place, Makes you feel good, and makes you Healthy!