Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: removing element from hash array

by Samy_rio (Vicar)
on Nov 16, 2005 at 14:06 UTC ( [id://509040]=note: print w/replies, xml ) Need Help??


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.


eval"print uc\"\\c$_\""for split'','j)@,/6%@0%2,`e@3!-9v2)/@|6%,53!-9@2~j';

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://509040]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-26 04:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found