list.txt (contains 3 enteries)
######
file1.html
file3.html
file2.html
######
data.txt (contains 2 enteries)
######
file3.html
file1.html
######
open (LIST, "list.txt");
@list = <LIST>;
chomp @list;
open (DATA, "data.txt");
@data = <DATA>;
chomp @data;
foreach $file (@list) {
foreach $line (@data) {
if ($file eq $line) {
print "$file exists\n";
}
}
}
############
It gives output:
file1.html exists
file3.html exists
My question how to Add file2.html DOESN't exist in the output.
The script is matching the files and reporting the files which exists, how can I get the files which are not matching?
TIA,
Zeshan.
######
file1.html
file3.html
file2.html
######
data.txt (contains 2 enteries)
######
file3.html
file1.html
######
open (LIST, "list.txt");
@list = <LIST>;
chomp @list;
open (DATA, "data.txt");
@data = <DATA>;
chomp @data;
foreach $file (@list) {
foreach $line (@data) {
if ($file eq $line) {
print "$file exists\n";
}
}
}
############
It gives output:
file1.html exists
file3.html exists
My question how to Add file2.html DOESN't exist in the output.
The script is matching the files and reporting the files which exists, how can I get the files which are not matching?
TIA,
Zeshan.