X360celib64r848VS2010zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip x360ce-lib64-r848-VS2010-zip ; print_log "Catch $dir "; } } A: The problem is that you are using m#, which uses m/regex/ as your pattern. This means that the slashes (/) inside your pattern have to match both the beginning and end of the string. You probably want to use a pattern with a delimiter like /, but since a text file is in reality a stream of bytes, you might have to do some prepending and appending to it in order to separate the lines. Here is how you could do it, using glob::Glob: use strict; use warnings; use feature'say'; use glob 'M:\download\*.txt'; foreach my $filename ( glob 'M:\download\*.txt' ) { say " filename: ", $filename; my @lines = split / /, ; my $ok = $filename =~ /x360ce-lib64-r848-VS2010-zip/; if ($ok) { print_log "Catch $filename "; } } output: filename: M:\download\x360ce-lib64-r848-VS2010-zip.txt filename: M:\download\x360ce-lib64-r848-VS2010-zip.txt filename: M:\download\x360ce-lib64-r848-VS2010-zip.txt filename: M:\download\x360ce-lib64-r848-VS2010-zip.txt 1cdb36666d
Related links:
Comments