in reply to removing element from hash array
Hi, Try this,
use warnings; use strict; use Data::Dumper; my %hoh; %hoh = ('list' => { 'find' => [ { 'type' => 'error', 'column' => '106', }, { 'type' => 'warning', 'column' => '1', } ]}); delete ($hoh{'list'}->{'find'}[1]->{'type'}); delete ($hoh{'list'}->{'find'}[1]->{'column'}); print Dumper (\%hoh); __END__ $VAR1 = { 'list' => { 'find' => [ { 'type' => 'error', 'column' => '106' }, {} ] } };
Updated :This will delete full second array element. Above code will delete particular element in array.
delete ($hoh{'list'}->{'find'}[1]);
Regards,
Velusamy R.
|
|---|