in reply to hash array removal ?

Dereference the array reference and apply splice.

my $position = 1; splice @{$hash->{'TRAPS'}{'TRAP_LIST'}}, $position, 1;

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: hash array removal ?
by meetraz (Hermit) on Feb 25, 2003 at 15:58 UTC
    I think $hash->{'TRAPS'} is an array ref, so the above code won't work. I think broquaint had it right, by doing:

    my $position = 1; splice @{$hash->{'TRAPS'}->{'TRAP_LIST'}}, $position, 1;

      Unless Zaxo modified his code without telling anyone, they're effectively the same thing. Second and subsequent dereferencing arrows are optional.

        Cool.. I learned something new. Is this why everybody's downmodding me? I was only trying to help....
      I think $hash->{'TRAPS'} is an array ref
      ...Yes it is