Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: removing element from hash array

by holli (Abbot)
on Nov 16, 2005 at 13:59 UTC ( [id://509035]=note: print w/replies, xml ) Need Help??


in reply to removing element from hash array

use strict; use warnings; use Data::Dumper; my %h = ( 'list' => { 'find' => [ { 'type' => 'error', 'column' => '1', }, { 'type' => 'warning', 'column' => '2', }, { 'type' => 'warning', 'column' => '3', } ] }, ); print Dumper (\%h); #use pop for last element #pop @{$h{list}->{find}}; #use slice for any other element @{$h{list}->{find}} = @{$h{list}->{find}}[0,2]; print Dumper (\%h);


holli, /regexed monk/

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2024-04-16 09:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found