# result if ($count){ print "$count matches\n"; } else { print "No matches found\n"; #### # search text file open IN, '<',$file or die "Could not open $file : $!"; while (my $line = ){ # repeat line search for each computer foreach my $search (@computers) { if ( my ($name) = $line =~ /($search[\.\w]*)/ ){ print "Name ; $name\n"; ++$count; } else if ( my ($name) = $line =~ /($search[-eq " "]*)/ ){ print "$name -- No matches found\n"; } } }