in reply to Map function that does not return undefined values

map will flatten lists you return... so you can do something like
map { defined $_ ? $_ : () } @array;
and will only get back the defined elements (kind of like you could do with grep, but more powerful)

all you have to do is add more interesting code to the map. Hope that is what you wanted...

Update BTW - you can also use that to add extra items to the array. If you return a list of multiple items from the code in map they will all be added to the output

print join(',',map { ($_,$_*2,$_*3) } (1,5)); #prints: 1,2,3,5,10,15

                - Ant
                - Some of my best work - (1 2 3)