Help for this page

Select Code to Download


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