in reply to [Solved] How does map work?

Hmm,

Altho' perfectly correct, methinx that the simple for loop construct you use is more normally written as

push @ret, $coderef->() for @params;

In fact, simpler still would be use the incoming arg list directly and to use parens for the non-core call to foo (as per PBP) ...

#!/usr/bin/env perl use 5.010; use strict; use warnings; sub foo(&@) { my $coderef = shift; my @ret; push @ret, $coderef->() for @_; return @ret; } my @a = ( "1", "2", "3", "4", ); my @b = foo( sub { $_ ** 2 }, @a);
Yet another product of an idle moment ...

A user level that continues to overstate my experience :-))