my @in = 1 .. 5; my @out = map $_ * 2, @in; # doubles each element of @in @out = map $_ * 2, 1 .. 5; # same thing - any list will do