in reply to How to match pattern and next 5 lines?

Two words: "stepwise refinement."

I understand that you are having some difficulty figuring this out, but starting from a top-down approach and doing stepwise refinement will allow you to arrive at your answer. Then, if your code does not work, you can post what you have and monks would be much more willing to help. If this sounds unfamiliar, you should read about stepwise refinement in this famous introduction by Niklaus Wirth.

In the meantime, this kind of looks like a homework problem. My suspicions are aroused.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

  • Comment on Re: How to match pattern and next 5 lines?

Replies are listed 'Best First'.
Re: Re: How to match pattern and next 5 lines?
by cacharbe (Curate) on Apr 06, 2002 at 22:57 UTC
    I don't know if it sounds like homework either. This task was one of the first tasks given to me when I started at my current position. They found out I knew perl, handed me some legacy code that was really slow, and said - "Here, fix this, and make it faster."

    I ended up re-writing an intranet application that retrieved stock information since many corporate employees weren't allowed internet access, but they still wanted to know certain, company related stock info (competitors, customers, etc...).

    Companies like Reuters have subscription services, but they are really costly, especially if you aren't using the information for trading.

    As far as content ripping goes, *shrug* I suppose if the anonymonk above was making the data available publically it couldbe a more severe issue, that's for his morals to decide.

    C-.

Re: Re: How to match pattern and next 5 lines?
by tstock (Curate) on Apr 06, 2002 at 21:40 UTC
    I don't know about "homework" but it sounds a lot like content ripping...