next if ($chromosome =~ /^chrM/);
You're very close, you just need to use the "binding operator" =~ instead of = and your code works. See also perlrequick and perlretut.
Note that if you're using warnings, which you should, you should have gotten a warning "Use of uninitialized value $_ in pattern match (m//)". See also Use strict and warnings.
BTW, please enclose your sample input data in <code> tags as well (not <p>).
In reply to Re: Trouble skipping lines using Perl
by haukex
in thread Trouble skipping lines using Perl
by LeBran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |