#!/usr/bin/perl use strict; use warnings; open (DATA, "found_vulns_test"); open (CVE_ID, "CVE_data_Demo"); my @cve_list = ; while () { chomp; my @list = split/,/; my $vuln = $list[1]; my @matched = (grep (/$vuln/, @cve_list)); # works up to here - grep outputs a string, right? But when I get to the next line, I get the scalar/count output... my @matched_cve = split(',', @matched); # Then I want to go through the fields as in the snippet below: $_= $matched_cve[1]; if( /COMPLETE|[C]/i ) { $biasedConf= 100; # percentage Confidentiality Impact values } elsif( /PARTIAL|[P]/i ) { $biasedConf= 50; # percentage Confidentiality Impact values } elsif( /NONE|[I]/i ) { $biasedConf= 0; # percentage Confidentiality Impact values } else { $biasedConf= 0; # percentage Confidentiality Impact values }; }