http://www.perlmonks.org?node_id=574710

After writing this code, I realized many people may have just not realized this is possible, so I think posting it here would make people think more about it.

I was writing a simple script wich would receive a attr=value,attr2=value2 string and automatically I wrote:

my %attrs = map { split /=/ } split /,/, $attr;

Well, the trick is that map doesn't have to return the same number of elements of the list it receives. If you returns a list inside a map, the resulting list will have more elements than the input list.

This sounds very intuitive to me, but maybe it's not for others...

daniel