in reply to Reading lines from a specific location in a text file.
Let's have a look at what code you have got so far!
If you only want text after the matching line, then the easiest approach is probably to set a 'flag' on successful matching :
use strict; use warnings; ## flag my $flag = 0; while(<DATA>){ my $line = $_; if ($flag){ ## we have already seen the flag, so print the line print $line; } else { ## haven't yet seen the flag ## so let's see if this line contains it if ($line =~ m/^Sentence/){ ## if we do see it, set the flag, ## so we no longer look for it, but just spew out the lines $flag = 1; } } }
|
|---|