in reply to Pattern Matching problem
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//)
|
|---|