Help for this page

Select Code to Download


  1. or download this
    %seen = (
        paul  => 1,
        jane  => 1,
        betty => 1,
    );
    
  2. or download this
    print for keys %seen;
    # will print paul, jane, betty (though not necessarily in this order, 
    +see note below)
    
  3. or download this
    $seen{paul} = 1;       # this does absolutely nothing! but...
    ++$seen{paul};         # paul's *value* is 2 now
    print for keys %seen;  # yet this still prints the same list
    
  4. or download this
    @list = grep !$temp{$_}++, @list; # same thing, shorter.