I'd like to create an array like this
@exclude = ("[INFO] Reading file", "[INFO] All file(s) read");
which contains items that I would like to ignore while looping through another array
The other array is @nyuulog which I've ready into from a file and looks similar to this:
[INFO] Uploading 37 article(s) from 3 file(s) totalling 23.98 MiB```
[INFO] Reading file 157.1.1.par2...
[INFO] Reading file 159.1.1.rar...
[INFO] Reading file 159.1.1.vol0+1.par2...
[INFO] All file(s) read...
[INFO] Finished uploading 23.98 MiB in 00:00:16.083 (1527.03 KiB/s). Raw upload: 2613.34 KiB/s
So I'm using this:
foreach $line(@nyuulog) {print $txtfile("$line\n");}
which writes all of the lines but I'm wanting to not write lines out to the filehandle that contains an element in the @exclude array.
Is there an easy way to do this? I've tried numerous attempts at using grep or the new Perl ~~ command (which I don't think applies in this situation) and can't get the right combination of commands.
Any help or pointing me in the right direction - would be greatly appreciated.
Thank you
next if $line =~ /\Q...\E$/
might be sufficient to skip any "progress" type lines.