while (<>) { chomp; if(/CANDIDATE (\d+)/){ $cand = $1; @acc = () } # if candidate line elsif (m{http://www.ncbi.nlm.nih.gov:80/entrez/query.fcgi} && m{(\w+)}) { push(@acc,$1); } # else if ncbi accession # elsif (m{R-score\s*=\s*(\S+);}) { print "$cand\t", join(",",@acc), "\t$1\n"; } # else if R-score, print this candidates info } # while reading web page