Sep 22, 2015, 7:57 AM
Post #1 of 4
I am trying to find out how to run a command on each line of a file.
how to run command on each line of file
There is a file, outputfile.txt with 4 lines in it. I am trying to get the command line command /usr/bin/reportlist to run on each line in that file. I know how to do this in bash, but not in perl. Can someone point me in the right direction?
Here's an example
$dir = "/tmp/dev_rmv";
my $file = </tmp/dev_rmv/outputfile.txt>;
open(my $outfh1, '>', '/tmp/dev_rmv/outputfile3.txt') or die "cannot open file";
#print $outfh1 "$LINE\n";