Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Remove key/value pairs from a hash

by cajun (Chaplain)
on Jun 11, 2005 at 06:01 UTC ( [id://465758]=note: print w/replies, xml ) Need Help??


in reply to Remove key/value pairs from a hash

Sorry, poor choice of words. The hash is written out to a file after the deletion of the records (key/value pairs). It has the same number of records (key/value pairs) after the deletion as it did before the deletion.

Thanks,
Mike

EDIT -

$before = keys %hash1; $after = keys %hash1;

Replies are listed 'Best First'.
Re^2: Remove key/value pairs from a hash
by ikegami (Patriarch) on Jun 11, 2005 at 06:27 UTC

    It still works... $before is 5, $after is 3

    The problem is obviously not with delete, but with your data. Why don't you dump the array, the before-hash and the after-hash using Data::Dumper as shown in my first post. That will show the problem with your real data.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-24 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found