in reply to Re^2: qx + sed not working
in thread qx + sed not working
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.
|
|---|