in reply to Regex for Differentiating Underscore and Whitespace

if you want to test if a string contains no underscore, use either if ($str !~ m/_/) or if ($str =~ m/\A[^_]*\z/).