Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by LanX (Sage)
on Feb 07, 2020 at 11:52 UTC ( #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? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2021-11-29 13:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?