Help for this page

Select Code to Download


  1. or download this
     my %cats;
    
    ...
        # @row contains the retrieved row
        push $cats{ $row[1] }, $row[0]; # "Hash of arrays structure"
      # End of loop to get a row
    
  2. or download this
      for  my $c (sort keys %cats){
         my $values = $cats{ $c };
         print "$c\t", join (" ", @$values), "\n";
      }
    
  3. or download this
      my $ItemsPerLine=3;
    
    ...
        print "\n" unless  $#$values % $ItemsPerLine==0;
      }