my @arr1; while ( <> ) { my @arr = split ',', $_; ( push @arr1, $arr[0] ) if $arr[2] eq 'particular'; }