Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

delete element in Hash of array

by Kandankarunai (Novice)
on May 23, 2011 at 09:33 UTC ( #906274=perlquestion: print w/replies, xml ) Need Help??
Kandankarunai has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks, How to delete a element in hash of array?

Replies are listed 'Best First'.
Re: delete element in Hash of array
by GrandFather (Sage) on May 23, 2011 at 09:39 UTC

    What have you tried and what documentation did you read?

    True laziness is hard work
Re: delete element in Hash of array
by jethro (Monsignor) on May 23, 2011 at 09:54 UTC

    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

      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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://906274]
Approved by GrandFather
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2018-05-26 09:15 GMT
Find Nodes?
    Voting Booth?