in reply to list lines not found in config (while+if)
#!/usr/bin/perl use strict ; use warnings ; my $file1 = shift; my $file2 = shift; open(IN,$file1) || die "Cannot open file $file1 $!\n"; my $content ; { local $/ ; $content = <IN> } close IN ; open(IN,$file2) || die "Cannot open file $file2 $!\n"; my @list = <IN> ; close IN ; my @new = grep($content !~ /$_->[0]\n/, map( [split(/,/, $_)], @list ) +) ; foreach( @new ) { print $_->[0] . " " .$_->[1] ; }
|
|---|