Help for this page

Select Code to Download


  1. or download this
    my %aMenu = { label => "  A", MenuItems => [ @MenuItems ] };
    
  2. or download this
    my %aMenu = ( label => "  A", MenuItems => [ @MenuItems ] );
    
  3. or download this
    # if  @MenuItems actually has something it it, then   MenuItems => [@M
    +enuItems]   is fine
    # but for simplicity i just made it MenuItems => []
    ...
    foreach my $app (map {lc $_} @sorted_applications) {
      push @{ $menus{$app}->{MenuItems} }, $app;
    }
    
  4. or download this
    my %menus;
    foreach my $app (map {lc $_} @sorted_applications) {
      $menus{$app} ||= { label => "  ".uc($app), MenuItems => [] };
      push @{ $menus{$app}->{MenuItems} }, $app;
    }