if ( $some_var =~ /'Opertations'/ ) { # Opertations? ;-) $doc_type = 2; }