Help for this page

Select Code to Download


  1. or download this
    my %hash = undef;
    
  2. or download this
    my %hash = ( key => "value", key2 => "value2" );   # OK
    my %hash = ( "key", "value", "key2", "value2" );   # OK (same)
    my %hash = ( "key", "value", "key2" );             # WRONG - gives the
    + error you describe
    my %hash = ( undef );                              # WRONG - equivalen
    +t to what you were doing!
    
  3. or download this
    undef %hash;
    %hash = ();         # empty list = empty hash