Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^6: Iterating over hash while deleting elements (Best Practice)

by LanX (Saint)
on Feb 07, 2020 at 11:52 UTC ( [id://11112557]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while (my $key = each %hash)
    {
    ...
          keys %hash;
      }
    }
    
  2. or download this
    my %seen;
    while (my $key = each %hash)
    ...
          keys %hash;
      }
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-19 15:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found