Help for this page

Select Code to Download


  1. or download this
    my @bb = 1..10;
    my %bb = @bb;
    require Data::Dumper;
    print Data::Dumper::Dumper(\%bb);
    
  2. or download this
    $VAR1 = {
              '9' => 10,
    ...
              '3' => 4,
              '1' => 2
            };
    
  3. or download this
    while (my ($key, $value) = each %bb) {
      print qq{$key contains $value\n};
    }
    
  4. or download this
    3 contains 4
    7 contains 8
    5 contains 6
    9 contains 10
    1 contains 2
    
  5. or download this
    printf qq{\n'keys' over "%s"\n}, join q{, }, @bb;
    foreach my $key (keys %{ {@bb} }) {
    ...
    foreach my $value (values %{ {@bb} }) {
      printf qq{key contains %s\n}, $value;
    }
    
  6. or download this
    'keys' over "1, 2, 3, 4, 5, 6, 7, 8, 9, 10"
    7 contains 8
    ...
    key contains 2
    key contains 4
    key contains 8