Help for this page

Select Code to Download


  1. or download this
    my $lastid = 0;
    while ($sth->fetch) {
    ...
            print "</tr><tr>";
        }
    }
    
  2. or download this
    alternate(
        sub { $sth->fetch },
    ...
        sub { $id },              # which variable to monitor
        sub { print "</tr><tr>" } # what to do when variable changes
    );
    
  3. or download this
    sub alternate {
        my $iter = shift;
    ...
        sub { $type },
        sub { print "</td><td>" }
    );