Help for this page

Select Code to Download


  1. or download this
    my %hash;
    @hash{ 3,4 } = qw( perl hacker );
    print join ",", keys %hash;      # prints "3,4"
    
  2. or download this
    my %hash;
    $hash{ 3,4 } = qw( perl hacker );
    print join ",", keys %hash;      # ????
    
  3. or download this
    my %hash;
    $hash{ (3,4) } = qw( perl hacker );
    print join ",", keys %hash;      # ????
    
  4. or download this
    my %hash;
    $hash{ [3,4] } = qw( perl hacker );
    print join ",", keys %hash;      # ????
    
  5. or download this
    my %hash;
    $hash{ 3,4 } = qw( perl hacker );
    print $hash{ 3,4 }, "\n";
    
  6. or download this
    my %hash;
    for my $i (0..5) {
    ...
      }
    }
    foreach ( keys %hash ) { print "$_ : ", $hash{ $_ }, "\n"; }
    
  7. or download this
    grep { nth_element_of_the_key eq 'test' } keys %hash;