use strict;
use warnings;
open my $file2, '<', 'file2.txt' or die 'Cannot open file2';
my @file_2 = <$file2>;
close $file2;
open my $file3, '<', 'file3.txt' or die 'Cannot open file3';
my @file_3 = <$file3>;
close $file3;
my $file = 'p4/file.ntp';
open my $DATA, '<', $file or die "could not open '$file' $!";
my %seen; # add this before loop
while (my $line = <DATA>){
(my $file_name) = $line =~ /
[\\\/] # Match but do not return a slash (or backslash)
( # Begin return
\w+ # One or more word characters (the name)
\. # one period
\w{1,3} # one to three word characters (extension)
) # End of return
; # Match but do not return a semi-colen;
/xms;
(my $VU_name) = /\s(VU\w+)/xms;
next if (!$file_name);
print $file_name, "\n";
# print grep /\/$file_name/, (@file_2, @file_3);
# next if ((!$VU_name) or ($seen{$VU_name}++));
# print "$VU_name\n";
# print grep /$VU_name/, (@file_2, @file_3);
}
close $DATA;