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.
In reply to Re: Scalar context of slice
by Xilman
in thread Scalar context of slice
by thenaz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |