Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: removing element from hash array

by wfsp (Abbot)
on Nov 16, 2005 at 14:04 UTC ( [id://509038]=note: print w/replies, xml ) Need Help??


in reply to removing element from hash array

or:

#!/bin/perl5 use strict; use warnings; use Data::Dumper; my %h = ( 'list' => { 'find' => [ { 'type' => 'error', 'column' => '106', }, { 'type' => 'warning', 'column' => '1', } ] } ); delete $h{list}{find}[1]; die Dumper(\%h); __DATA__ ---------- Capture Output ---------- > "c:\perl\bin\perl.exe" _new.pl $VAR1 = { 'list' => { 'find' => [ { 'type' => 'error', 'column' => '106' } ] } }; > Terminated with exit code 255.

Replies are listed 'Best First'.
Re^2: removing element from hash array
by Errto (Vicar) on Nov 16, 2005 at 23:47 UTC
    Weird. All this time I thought delete only worked on hashes and you had to use splice for arrays, but I was obviously wrong.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-03-28 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found