I am new to perl and need a small help in perl.
I have a csv ( comma separated file with two fields)
contents and format of the file is below:
File name : input_file.csv
Logic: There are two fields in the csv file. I have to compare each value in field1 with each value in field2. if any value in field2 is not present in field1, then only those should be printed to a output file called output.csv.
I tried the below code. I stuck with looping the array elements.
It would be great if anyone can help me.
code, I tried so far
$source_file = 'C:\\input_file.csv';
open (FH, $source_file) || die ("Could not open $source_file!");
while ($line = <FH>)
($field1,$field2) = split ',', $line;
print "$field1, $field2";
if ($field1 eq $field2)