in reply to Open a file, search for a string and fill a string in another file
G'day ramki067,
Given your $RESULTS_FILE is a web page, and therefore not of inordinate length, Tie::File might be a good option here.
In place of "open OUT, ...", use
tie my @results, 'Tie::File', $RESULTS_FILE;
and, in place of "while $srch(<OUT>) {...}", use
for (@results) { last if s/search/replace/; }
Additionally, there's a few issues with your code:
-- Ken
|
|---|