First of all, most Perl coders will not assume that "empty" means "may contain spaces". Empty is just that, void of everything. So, and "empty string" is usually understood to be a string containing no characters at all: its length is zero. This includes the undefined value, as undef in string context acts like a string of zero length.
So, your question becomes, how do I match strings that contain nothing but spaces? Translated into regexp speak, all you want to encounter between the beginning and end of a string is spaces. Translated to code, that is:
/\A *\z/