@array = ( 'a', 'b', 'c', 'd', 'e' ); %hash = ( a => 0, b => 1, c => 2, d => 3, e => 4 ); @indices = ( 2, 3); @keys = ( 'c', 'd' ); undef @array[ @indices ]; # undefs value of/in @array[3] undef @hash{ @keys }; # undefs value of/in $hash{d} use Data::Dumper; print Dumper \%hash; print Dumper \@array; __END__ $VAR1 = { 'e' => 4, 'c' => 2, 'a' => 0, 'b' => 1, 'd' => undef }; $VAR1 = [ 'a', 'b', 'c', undef, 'e' ];