in reply to Re^2: Need help with perl syntax.
in thread Need help with perl syntax.

my @y = map { ... } @x;
is more or less equivalent to
my @anon; for (@x) { push @anon, do { ... }; } my @y = @anon;

Yes it can be simplified, which I proceeded to do in the next snippet.

Replies are listed 'Best First'.
Re^4: Need help with perl syntax.
by jwkrahn (Abbot) on Mar 14, 2008 at 19:10 UTC

    Yes but you don't need a code block in either case.  my %quick_allow = map { $_ => 1 } @allow_users; could also be written as  my %quick_allow = map( ( $_ => 1 ), @allow_users );.

      Yes, but I wasn't giving the for equiv for map EXPR, LIST, but the syntax he used.