The problem you have is that you're misunderstanding quantification of metacharacters, and metacharacters themselves. \w matches one "word" character, not a bunch of characters. \w also does not match "5.0.29.0", for example. Also, '.' matches any character except for newline, so it must be escaped, as in \. if you want it to be seen as a literal character in the pattern match. You probably want something more like this:
m/Rescue21.+patch.+DiffList\.txt/
...or...
{
local $_ = $mystring;
if( /Rescue21/ && /patch/ && /DiffList.txt/ ) {
#....
}
}
...though the latter would give a false positive if the filename looked like "DiffList.txt_patch_Rescue21". In other words, the latter solution wouldn't reject matches where the keywords appeared out of order.
|