in reply to otherwise condition
while ($line=<INFILE>) { chomp $line; if ($line=~/^COMPND[\s]{3}3/) { $line=join(' ',split(' ',$line)); # 1 chop $line; # 2 $chain=substr($line,length($line)-1,1); # 3 $lastchain=$chain; # 4 print OUTFILE ("$chain\n"); } else { $lastchain='@'; # 5 } }
Okaaaay. I suspect that lines 1-5 are not doing what you think they're doing.
The else statement looks just fine, to me.
------
We are the carpenters and bricklayers of the Information Age.
The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: otherwise condition
by bobn (Chaplain) on Aug 25, 2003 at 13:55 UTC |