Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Trouble skipping lines using Perl

by Eily (Monsignor)
on Nov 21, 2017 at 16:16 UTC ( [id://1203906]=note: print w/replies, xml ) Need Help??


in reply to Trouble skipping lines using Perl

$chromosome =~ /^chrM/ may do what you need if you want $chromosome to start with chrM (that's what ^ means, it's the start of the string). Note that if you want to check if it is equal to "chrM" this is done with the eq operator, so $chromosome eq "chrM" (see Relational Operators and Equality Operators)

Also FYI if you want to check that a string is contained in another, you can use index which is easier to use and less tricky than regular expressions.

Replies are listed 'Best First'.
Re^2: Trouble skipping lines using Perl
by LeBran (Initiate) on Nov 21, 2017 at 17:05 UTC

    Hi,

    Yeah that  eq operator actually seems really useful, and presumably would deal with certain warnings in relation to using a =

    Cheers

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1203906]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-24 07:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found