I thought that the forward slashes were for characters with special meaning.
Technically, the forward slashes are known as the m// operator, and anything between the delimiters (in this case slashes) is a regular expression. In a regular expression, some characters have special meaning, such as .*?, and others do not - mostly the "word" characters such as a-zA-Z0-9 and so on. Such characters are matched literally, so /not stop/ just means to look for the eight characters not stop.
if($CPC_stop_type[$i] !~ not stop){
If you're using strict, as one generally should, that's thoeretically valid Perl if you've got a sub stop - but I doubt this statement makes sense. If you're not using strict, that's valid Perl, because not is an operator and stop is taken as a so-called "bareword", but that's getting into details that probably aren't relevant here.
As for the rest of your question, sorry, but I don't understand what you are trying to do. If you want to check whether a string...
- contains not stop, use $string =~ /not stop/.
- doesn't contain not stop, use $string !~ /not stop/.
- is exactly "not stop", use $string eq "not stop".
- is not exactly "not stop", use $string ne "not stop".
There are of course additional options - if you wanted to express "does this string contain not stop or power-off stop", you could write that as $string =~ /(?:power-off|not) stop/.
If things aren't working as you expect, then please see How do I post a question effectively? and Short, Self-Contained, Correct Example: Please provide a short, runnable piece of code that demonstrates the problems you're having, along with short but representative sample input, the expected output for that input, the actual output you're getting, including any error messages, each within <code> tags.
| [reply] [d/l] [select] |