in reply to Trouble skipping lines using Perl
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>).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Trouble skipping lines using Perl
by LeBran (Initiate) on Nov 21, 2017 at 16:11 UTC | |
by haukex (Archbishop) on Nov 21, 2017 at 16:19 UTC | |
by LeBran (Initiate) on Nov 21, 2017 at 16:55 UTC | |
by roboticus (Chancellor) on Nov 21, 2017 at 16:30 UTC | |
by LeBran (Initiate) on Nov 21, 2017 at 17:03 UTC | |
by AnomalousMonk (Archbishop) on Nov 21, 2017 at 17:23 UTC | |
by AnomalousMonk (Archbishop) on Nov 21, 2017 at 17:49 UTC | |
by LeBran (Initiate) on Nov 22, 2017 at 11:03 UTC |