To determine if a widget has been created and not destroyed, use Exists($widget):
if (Exists($widget)) { ... }
Note the uppercase E on this method. The Exists method is different from the built-in Perl exists function. Make sure you don't confuse the two.