Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I want to start processing the file where the line begins with "internal name". After this I only want to process the lines that have "need this" in them until end of file. Where "need this" always occurs at the beginning of the line.a line another line internal name another line a further line need this another line need this
This doesn't work because each time round the loop it searches for "internal name".open DATA,filename; while (<DATA>) { chomp; next unless (/^internal name/); next unless (/^need this/); do something with data } close DATA;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: seek and process from there on
by blazar (Canon) on May 30, 2006 at 13:38 UTC | |
|
Re: seek and process from there on
by davorg (Chancellor) on May 30, 2006 at 14:07 UTC | |
|
Re: seek and process from there on
by holli (Abbot) on May 30, 2006 at 13:58 UTC | |
|
Re: seek and process from there on
by Zaxo (Archbishop) on May 30, 2006 at 14:15 UTC | |
by Anonymous Monk on May 30, 2006 at 14:57 UTC | |
by qazwart (Scribe) on May 30, 2006 at 15:47 UTC | |
by blazar (Canon) on May 30, 2006 at 15:30 UTC | |
|
Re: seek and process from there on
by rminner (Chaplain) on May 30, 2006 at 13:52 UTC | |
by blazar (Canon) on May 30, 2006 at 14:06 UTC | |
|
Re: seek and process from there on
by Tobin Cataldo (Monk) on May 30, 2006 at 13:37 UTC | |
by blazar (Canon) on May 30, 2006 at 13:47 UTC | |
|
Re: seek and process from there on
by zakame (Pilgrim) on May 30, 2006 at 15:56 UTC | |
|
Re: seek and process from there on
by leocharre (Priest) on May 30, 2006 at 16:02 UTC |