Perl: conditionally match multiple lines# Unix - 噫吁兮,危乎高哉
r*o
1 楼
I only know how to read a file line by line
or read in the whole file as a string.
But how to read/match multiple lines conditionally?
e.g. a file contains certain lables:
xxx
yyy
Begin: zzz
aaa
bbb
Ene: ccc
ddd
I need the script to read/match multiple lines between the Begin/End
pair as a single string. But for other lines, just read
them one by one.
Is there any easy way to do this?
Thanks.
or read in the whole file as a string.
But how to read/match multiple lines conditionally?
e.g. a file contains certain lables:
xxx
yyy
Begin: zzz
aaa
bbb
Ene: ccc
ddd
I need the script to read/match multiple lines between the Begin/End
pair as a single string. But for other lines, just read
them one by one.
Is there any easy way to do this?
Thanks.