Sorry I stupidly edited my comment just as you typed yes.  For clarification the 
$globals =
or the
if?