in reply to Re^2: Get file part from the section where the matched pattern is found.
in thread Get file part from the section where the matched pattern is found.
if you meant that you want to print the line with the regex and the next line to it
then simply add last; in the first if section
this will get you the outputif($found) { print "$line"; last; }
startdexdbnjcrk this when be shown
UPDATE:and if you want to print more lines then youll be needing a counter and check each time with "if" weather the desired number of lines have been printed or not. if yes then exit.
|
|---|