use WWW::Mechanize; ($fasta, $type) = @ARGV; #type -> euk, Gpos, Gneg $outfile = $fasta.".SIGNALCF"; open OUT, ">>$outfile"; open IN, $fasta; while() { if($_=~/^>(.*)/) { $id=$1; $seq=; chomp $seq; $mikos=length($seq); $url = 'http://www.csbio.sjtu.edu.cn/bioinf/Signal-CF/'; $mech = WWW::Mechanize->new(); $mech->get($url); $mech->submit_form ( form_number => 1, fields => { #textarea name | value S1 => $seq, #Radio button name | value R2 => $type } ); $result = $mech->content(); #case with NO signal peptide if($result=~/According to our computational result, your input sequence/) {print OUT $id."\t0\n";} #case with signal peptide if($result=~/According to our computational results, the signal peptide is:\1\-(\d+)\<\/font>/) {$sp_end=$1; print OUT $id."\t".$sp_end."\n";} } } close IN; close OUT;