Help for this page

Select Code to Download


  1. or download this
    my @array = (
      {TYPE =>  "hole", SIZE => 126, STEP =>   "pcb", COMP =>  "none"},
    ...
      {TYPE => "chain", SIZE =>  96, STEP => "array", COMP => "right"},
      {TYPE =>  "slot", SIZE => 130, STEP => "panel", COMP =>  "left"},
    );
    
  2. or download this
    @sorted = sort {$a->{SIZE} <=> $b->{SIZE}} @array;
    
  3. or download this
    my @indices = sort {$hash{SIZE}[$a] <=> $hash{SIZE}[$b]} 0..$#{$hash{S
    +IZE}};
    foreach my $key (keys %hash) {
      @{$hash{$key}} =  @{$hash{$key}}[@indices]; # Slice
    }