my $str = "foo.bar"; if ($str =~ /\./) { print "Contains a period.\n"; }