in reply to Re: reading lines from a text file
in thread reading lines from a text file
Now, in the above code, i am trying to read the next line using inner "while" until I reach the search string which I think is not working for me. I want to know whether reading the subsequent lines of file inside outer while loop works or not. If it does not, what is other way of achieving it? Thanks again.while ( $line = <FH> ) { if ( $line =~ /$SearchString/) { while(($nextline=<FH>) and ($nextline=~/$SearchString/)) { push @temp $nextline; } #close of inner while } #close of if } #close of while
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: reading lines from a text file
by Corion (Patriarch) on Dec 27, 2008 at 09:51 UTC | |
by misba (Initiate) on Dec 27, 2008 at 10:53 UTC | |
by ikegami (Patriarch) on Dec 27, 2008 at 11:13 UTC | |
by baxy77bax (Deacon) on Dec 27, 2008 at 11:36 UTC |