in reply to Odd (to me) case of wrongly guessing context

rjt already answered your question, allow me a hint for the future:

In such cases B::Deparse is your friend

perl -MO=Deparse,-p -e 'my ($not_foo) = context() // print "Whoops"' (my($not_foo) = (context() // print('Whoops')));

Used -p to add extra parens to highlight precedence.

Cheers Rolf

( addicted to the Perl Programming Language)