sel.pl 227 Bytes
Newer Older
Loïc Barrault's avatar
Loïc Barrault committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22


$print=0;
while (<>) {
    if (/<BEGIN>/) {
	$print=1;
    } elsif (/<END>/) {
	$print=0;
    } elsif ($print) {
	print;
    } 
}

exit;

while (<>) {
    last if /<BEGIN>/;
} 
while (<>) {
    last if /<END>/;
    print;
}