my $data = $text -> get('1.0','end'); if ($text actually_contains_text) { do some stuff } else { skip to the next step }