in reply to Hash-O-Array Help

Use parens instead of curly braces when defining a hash

my %H1 = ( 'THINGS' => ['thing1', 'thing2'], 'PEOPLE' => ['andy', 'margot', 'dave', 'joe'], );

Replies are listed 'Best First'.
Re^2: Hash-O-Array Help
by Anonymous Monk on Oct 29, 2008 at 23:36 UTC
    Thanks ccn. Now if I wanted to delete 'dave' I could do ...
    delete @{$H1{'PEOPLE'}}[2];
    ... but that leaves my hash looking like this ...
    $VAR1 = 'PEOPLE'; $VAR2 = [ 'andy', 'margot', undef, 'joe' ]; $VAR3 = 'THINGS'; $VAR4 = [ 'thing1', 'thing2' ];
    How can I free up that 'undef' array element ? Thanks