Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: multi line regex

by Happy-the-monk (Abbot)
on Jan 09, 2006 at 14:39 UTC ( #521945=note: print w/ replies, xml ) Need Help??


in reply to multi line regex

You read the file into an array of lines, then you compare single lines against something that suspiciously looks like a multi-line-structure. You probably have to slurp the whole file into the scalar and not use the for loop:

my $entry = do { local $/; <INFO> }; # slurp the whole file

To which Corion adds:

with the /x modifier you will have to match all the whitespace explicitly, meaning to put \s+ here and there and everywhere you might expect whitespace.

Cheers, Sören


Comment on Re: multi line regex
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2015-09-04 02:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred temperature scale is:










    Results (128 votes), past polls