Help for this page

Select Code to Download


  1. or download this
    my %foo = (
        'one' => 1,
        'two' => 2,
    ...
    );
    print @foo{ 'one', 'two' }, "\n";
    print @foo{ 'three', 'four' }, "\n";
    
  2. or download this
    my %foo = ();
    
    @foo{ 'one', 'two' } = (1, 2);
    @foo{ 'three', 'four' } = (3, 4);
    
    print keys %foo;