Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: regex on previous lines

by LanX (Canon)
on Jan 31, 2013 at 17:28 UTC ( #1016365=note: print w/ replies, xml ) Need Help??


in reply to regex on previous lines

read lines reversed into an array

@lines=reverse <$fh>

or

@lines=reverse split /\n/, $multiline

Now you can loop over @lines and exit with last whenever a regex fails.

Cheers Rolf


Comment on Re: regex on previous lines
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2015-05-04 00:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    In my home, the TV remote control is ...









    Results (79 votes), past polls