Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Look Ahead regexp to insert line?

by BillKSmith (Deacon)
on Oct 02, 2012 at 01:29 UTC ( #996783=note: print w/ replies, xml ) Need Help??


in reply to Look Ahead regexp to insert line?

If the file is not to large, it probably is easier to slurp the file into an array and then go through the array backwards looking for the first occurance.

Update: I just heard of the module File::ReadBackwards. It may be what you need for longer files.

Bill


Comment on Re: Look Ahead regexp to insert line?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (13)
As of 2015-08-28 20:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (341 votes), past polls