map itself is in void context in each of those. The block is evaluated in list context in each of those. Only the context in which the subroutine is evaluated is changing. This is what wantarray reports.