Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^4: Perl reading in a file and getting a string in between two strings on different lines

by LanX (Saint)
on Apr 17, 2017 at 21:56 UTC ( [id://1188179]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Perl reading in a file and getting a string in between two strings on different lines
in thread Perl reading in a file and getting a string in between two strings on different lines

Show input that doesn't work! See SSCCE

That's a classic, most likely you are doing it wrong.

The only possibility top make it foolproof is to quote regex metacharacters and to anchor the line's start with ^

print if /^\Q$beginString/ .. /^\Q$endString/;

See quotemeta

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

  • Comment on Re^4: Perl reading in a file and getting a string in between two strings on different lines
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-20 03:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found