Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: regex on previous lines

by LanX (Chancellor)
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

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 pondering the Monastery: (5)
As of 2016-10-01 11:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (576 votes). Check out past polls.