in reply to regex in list context

You're not assigning the result of the match, you're assigning the result of !~.

The result of != is the logical negation of the result of its RHS argument.

(The result of ~= is the result of its RHS argument.)