#!/usr/bin/perl -w use 5.014; #992723 my @temp =; my $f=join("",@temp); my @lastreco=split("\n",$f); foreach (@lastreco) { my @t= split("\t",$_); say "testing: $t[6]"; if ($t[6] =~ /HIGH/ && /LOW/ && /LRR/) { print "matched: $1\n"; } } =head unmodified sample data has spaces, not tabs 860414 31 290 28 299 00931.17 HIGH CL1122 860412 501 541 501 554 00977.18 LRR_4 CL0022 860415 501 541 511 564 00977.33 LOW CL0023 =cut __DATA__ 860414 31 290 28 299 00931.17 HIGH CL1122 654321 404 403 402 401 011.1111 ARR34 CL0024 860412 501 541 501 554 00977.18 LRR_4 CL0022 860415 501 541 511 564 00977.33 LOW CL0023 123456 404 403 402 401 011.1111 MED CL0024 #### testing: HIGH testing: ARR34 testing: LRR_4 testing: LOW testing: MED