map{} will not be faster than foreach!!! map is a slow but very powerful critter. map{} takes an input array and makes a new output array. foreach my $x (@input){} iterates over an existing array. @output = map{...}@input, makes a new array from the input - it transforms one array into a new array. Don't use map{} if you don't use the output of map{}, ie there should always be some use of the map array output.