I went with
next if ($chromosome =~ "chrM");
That works, but personally I wouldn't write it that way, because writing a regex like for example /chrM/ or m{chrM} makes it more visually clear what you want to do (and also allows you to add modifiers).
I was using both Strict and Warnings and using the quotes instead of the regex doesn't produce any warnings
Are you sure? next if ($chromosome = "chrM"); should have given you the warning "Found = in conditional, should be ==". Perhaps you're not enabling warnings correctly?
Update:
My apologies about the input data format
You can edit your posts (please mark updates as such), see How do I change/delete my post?
In reply to Re^3: Trouble skipping lines using Perl
by haukex
in thread Trouble skipping lines using Perl
by LeBran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |