Help for this page

Select Code to Download


  1. or download this
    my $len = length;
    $bins{$len} //= [ ];      # Set to blank array ref if not already set.
    push @{$bins{$len}}, $a;  # Add $a to the array
    
  2. or download this
    for my $len (sort { $a <=> $b } keys %bins) {
        say "Length $len:";
        say for @{$bins{$_}};
    }