Jonathan (>):
> That this means the { $_ => uc $_; } above would end up composing a Hash
> object (unless the semicolon is meant to throw a spanner in the
> hash-composer works?) It says you can use sub to disambiguate, but
>
> %ret = map sub { $_ => uc $_; }, split "", $text;
>
> Doesn't work since $_ isn't an automatic parameter for a sub, like it would
> be in just a block (in the implementation, and if I understand correctly in
> the spec too).

Out of curiosity, would this work?

%ret = map -> { $_ => uc $_; }, split "", $text;

Or this?

%ret = map { $^foo => uc $^foo; }, split "", $text;

-- 
Carl Mäsak

Reply via email to