Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: map {} list or do {} for list?

by LanX (Saint)
on Apr 11, 2014 at 14:29 UTC ( [id://1081974]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    for my $key ( keys %hosts ) {
        if ( $hosts{$key} != $table_count ) {
            delete $hosts{$key};
        }
    }
    
  2. or download this
    while ( my ($key,$value) = each %hosts) {
        delete $hosts{$key}
          if $value != $table_count;
    }
    
  3. or download this
    while (($key, $value) = each %hash) {
        print $key, "\n";
        delete $hash{$key};   # This is safe
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 22:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found