On Mon, 20 Feb 2012 20:08:31 +0100, Manfred Lotz <[email protected]> wrote:

Hi there,

I have a hash table where I want to do some action for each value in
the hash table.



Among other possibilities I could do like this:
   map { some_action($_) } values %ht;

where let us say:

sub some_action {
   ...

   return;
}

I like it because it is really short.


Questions:
1. Is there another perhaps better one liner to do it?

You can do either of these:

 map some_action($_), values %ht;

 some_action($_) for values %ht;

--
With regards,
Christian Walde

--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to