if ($string =~ /\ # literal space here /) { # do this or that }