if (my ($match) = /(\Q$string\E\S*)/) { print "Matched '$string' in '$match'.\n"; }
Note that
my $content =~ m/.../g;
is not doing what you think. By adding my, you make $content undefined, so matching it against anything non-empty returns false. You should use warnings which would tell you:
Use of uninitialized value $content in pattern match (m//)
In reply to Re: Pattern Matching problem
by choroba
in thread Pattern Matching problem
by auhakim
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |