- or download this
my $tag = "";
while (<DATA>) {
($tag = $1, next) if /\{(\w+)\}/;
print $_ if $tag eq "AUTHOR";
}
- or download this
my $tag = "";
while (<DATA>) {
...
next if /\{/;
print $_ if $tag eq "AUTHOR";
}
- or download this
my $flag = 0;
while (<DATA>) {
$flag = ($1 eq "AUTHOR") if /^\{(\w+)\}$/;
print $_ if $flag and not /^\{/;
}