$_ = "yabba dabba doo";
if (/abba/) {
print "It matched!\n";
}
The expression /abba/ looks for that four-letter
string in $_; if it finds it, it returns a true
value. In this case, it's found more than once, but that
doesn't make any difference. If it's found at all,
it's a match; if it's not in there at all, it fails.
Because the pattern match is generally being used to return a true or
false value, it is almost always found in the conditional expression
of if or while.
All of the usual backslash escapes that you can put into
double-quoted strings are available in patterns, so you could use the
pattern /coke\tsprite/ to match the eleven
characters of coke, a tab, and
sprite.