in reply to Removing characters

As you've defined characters, it seems that a string that doesn't contain any characters will be an empty string. Is that correct?

If so, you can use

if ($value eq "") { # contains no characters }
If that's not what you meant, try clarifying what you mean *exactly* by characters.