ファイル内の特定の行を一致させたいのですが、特定の行を一致させた後、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;
}
}
私は何を間違っていますか?