foreach my $root (map { sqrt($_) }@data) { #do something with this square root... }