in reply to Guess the output.

Can you guess what this would do before you try it?

Yes.

I couldn't see why it would print anything but an empty string, and I suspected it would give the "void context" warning.

a !~ b is the same thing as !(a =~ b). I don't know if that's intuitive or not (since I learned its meaning long ago), but it's well documented. Since a =~ b returns true when characters were replaced or deleted, a !~ b returns true when no characters are replaced or deleted. Your snippet prints an empty string because tr[a][]d executes as normal. Only the return value is negated.

Furthermore, the negated value is discarded. When the return value of an action with no side effects is discarded, you should you get a "void context" warning. The following give void context warnings as well: (from least obvious to most obvious)

Update: Rearranged the post (including earlier updates) so more would be behind the spoiler tag.