Piers Cawley pointed out:

%a_students = grep {.key ~~ :i/^a/}, %grades.kv;
I think you could probably get away without the .kv there since, in a
list context you're going to get a list of pairs anyway.
In fact, the code is invalid as it stands. The following variations
work as desired:

	%a_students = grep {.key ~~ /:i^a/} %grades;
or:
	%a_students = grep {.key ~~ m:i/^a/} %grades;
or:
	%a_students = grep sub($k,$v){$k ~~ m:i/^a/}, %grades.kv;
	
Damian

Reply via email to