sub check_age { if ((!$age) || ($age=~ m/[a-z]/i)) { $age_entry->messageBox( -icon => 'error',-message => 'age should not contain characters' ,-type => 'Ok'); ...