我想匹配文件中的特定行,在匹配特定行后,我想跳过 5 行并打印下一行。例如
Lecture <==(I want to match lecture)
1
2
3
4
5
Hello <==(And then i want to print this line)
我试过这样做,但它不会工作:
if ($line =~ m/(Lecture)/) {
$1 = $currentLine;
if ($currentLine == $1+6) {
print $currentLine;
}
}
我究竟做错了什么?