...unless $cnf{from} && $cnf{from} =~ m/\@/; #### my $string = 'one@two.com'; if( $string =~ m/\@/ ) { print 'yes'; }