Help for this page

Select Code to Download


  1. or download this
    my %quick_allow = map { $_ => 1 } @allow_users;
    
  2. or download this
    my @anon;
    for (@allow_users) {
       push @anon, do { $_ => 1 };
    }
    my %quick_allow = @anon;
    
  3. or download this
    my %quick_allow;
    for (@allow_users) {
       $quick_allow{$_} = 1;
    }
    
  4. or download this
    my %ALL_USER_GROUPS = (
                        23 => [ qw( g1  g4 ) ],
                        13 => [ qw( g3  g5 ) ],
                        );
    
  5. or download this
    my %ALL_USER_GROUPS = (
                      # key   value
    ...
                        '23', [ 'g1', 'g4' ],
                        '13', [ 'g3', 'g5' ],
                        );
    
  6. or download this
    # At the outmost level, you have a list of groups stored in a hash.
    # List the keys (group ids) and fetch the corresponding value (group m
    +embers).
    ...
    
       print("\n");
    }
    
  7. or download this
    for my $gid ( keys %ALL_USER_GROUPS )
       my $members = $ALL_USER_GROUPS{$gid};
    ...
       print("Members: ", join(' ', @$members), "\n");
       print("\n");
    }