| Next |  Program Repair Shop  | 137 | 

          my @lib = @$lines;
        
          # This for loop does not allow return until each sub is finished
          for ($j=0; $j < @lib; $j++) {
            
            # Reading the first delimiter line and 'Title' line altogether
            if ($lib[$j]=~/^\#[\-_]{50,}/ ) { 
              next;
            } elsif ( $lib[$j]=~/^(\#+ *title *: *([\w\-\.]+))/i ) {
              $long_subname=$1;  $sub_name=$2; $title_found=1;
              if ($sub_name=~/\.pl$/) {
                next;
              }                         ## to avoid the very first headbox
              $out_subs{"$sub_name"}{'title'}="$sub_name";
              ...
            }
            ...
          }
Replace for ($j=0; $j < @lib; $j++) with for my $line (@lib)
Replace $lib[$j] with $line
95% of C-style for loops can be replaced this way
 
Loop Counter Variables
| Next |  | Copyright © 2001 M. J. Dominus |