Without shelling out:
#!/usr/bin/env perl use strict; use warnings; use Path::Tiny; chomp (my @SetBCs = <DATA>); for my $fname (@SetBCs) { next unless $fname; my @command = grep {/Sets/ .. /Rules/} path ($fname)->lines; print @command; } __DATA__ C:/ProcessFiles/File1.txt C:/ProcessFiles/File2.txt C:/ProcessFiles/File3.txt C:/ProcessFiles/File4.txt C:/ProcessFiles/File5.txt
That's just one way. You can put your loading of @SetBCs back to reading from the file, but the rest of it should work fine as-is.
In reply to Re^3: qx + sed not working
by hippo
in thread qx + sed not working
by Maestro815
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |