Help for this page

Select Code to Download


  1. or download this
    use Tie::Judy;
    
    tie %fruit_color, 'Tie::Judy';
    
  2. or download this
    my %fruit_color = ("apple", "red", "banana", "yellow");
    
  3. or download this
    my %fruit_color = (
        apple  => "red",
        banana => "yellow",
    );
    
  4. or download this
    $fruit_color{"apple"};           # gives "red"
    
  5. or download this
    my @fruits = keys %fruit_color;
    my @colors = values %fruit_color;