in reply to Scalar context of slice

In scalar context, @bar{'a', 'b'} is the last element of the list, '' in your example.

The result of the map in list context is a copy of bar but, when evaluated in scalar context, gives the length of the list it copies.

More on p76 of The Camel Book, 3rd Ed.