logo       

if loop problem: msg#00416

perl-beginners

Subject: if loop problem

Hi All,

I am having a small problem with my if looops. I have
written a small script to parse a file I have

input:

HMU00030 2522 4840 DNA gyrase subunit B
HMU00040 4841 5083 putative membrane protein
HMU00050 5080 5739 c putative periplasmic C39-family
peptidase
HMU00060 5739 6549 c putative inner membrane protein

Wrote a perl script to convert c in fourth column to - and
if not equal to see then +

while(<>){
($Gene, $Start, $Stop, $strand, $Product) = split(/\t/,
$_);
if ($strand eq "c"){
print "$Gene\t-\t$Start\t$Stop\t$Product\n";
}else{
print "$Gene\t+\t$Start\t$Stop\t$Product\n";
}
}

unfortunatly output is either all + or all - ?
any ideas?

regards

Brian

--
To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx
For additional commands, e-mail: beginners-help@xxxxxxxx
http://learn.perl.org/


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise