Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: delete element in Hash of array

by jethro (Monsignor)
on May 23, 2011 at 09:54 UTC ( [id://906277]=note: print w/replies, xml ) Need Help??


in reply to delete element in Hash of array

splice(@{$hash{'thingy'}},$position,1);

You can always access the array inside a hash of arrays if you put @{} around the hash value $hash{'thingy'}. Quite simple after you get used to it

Replies are listed 'Best First'.
Re^2: delete element in Hash of array
by doubledecker (Scribe) on May 23, 2011 at 11:57 UTC

    Assuming if you know the key you want to delete..

    delete $hash{$key};
      Unfortunately the question is so poorly phrased, that nobody can tell in which nesting level an element should be deleted.

      You're answering another question than jethro did.

      Cheers Rolf

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-03-19 14:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found