Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://521945]
help
Chatterbox?
[LanX]: what is the intention of your question?
[LanX]: why do you need to see the nodelet without votes left???
[marinersk]: LanX, the problem is that the lack of interface visual stability is disconcerting to me. The Nodelet appearing and disappearing is distracting, and despite over a decade, still troubles me. It jangles me.
[LanX]: I see
[marinersk]: I appear to be unusually dependent on spacial stability. I have had trouble from someone moving an object a mere four inches to the left.
[Eily]: I think the solution is to write posts so brilliant that you gain XP on each refresh, no matter how often :P

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2017-05-29 13:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?