In Perl I'm trying to achieve this:
while ($row = <$fh>){
if the row contains the character >:
#do something AND then skip to the next line
else:
#continue to parse normally and do other things
You can skip to the next iteration of a loop with the next built-in. Since you are reading line by line, that's all you need to do.
For checking if the character is present, use a regular expression. That's done with the m// operator and =~ in Perl.
while ($row = <$fh>) {
if ( $row =~ m/>/ ) {
# do stuff ...
next;
}
# no need for else
# continue and do other stuff ...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With