my @list = ( 5, 11, 7); my @timesthree = map { $_ *= 3 } (@list); #### my @timesthree_onlyfives = map { $_ *= 3 if ($_ % 5 == 0) } (@list); #### my @all_timesthree_onlyfives = map { if ($_ % 5 ==0) { $_ *= 5; } else { return $_; } } (@list);