Help for this page

Select Code to Download


  1. or download this
    my %order;
    while ( my $rec = $data->fetchrow_hashref ) {
        push @{ $result{ $rec->{"ID"} } }, $rec->{"item"};
        push @order, $rec->{ID};                           # read order
    }
    
  2. or download this
    my $last = $order[0];                                  # first key
    
    ...
       compare($last,$cur);
       $last = $cur;                                       # keep current 
    +as last
    }
    
  3. or download this
    sub compare {
      my ($previous,$present) = @_;
      ...
    }