Check the lexical scoping of the switch keywords. (The actual behaviour is tested in t/op/switch.t) __END__ # No switch; given should be a bareword. use warnings; no warnings 'experimental::smartmatch'; print STDOUT given; EXPECT Unquoted string "given" may clash with future reserved word at - line 3. given ######## # No switch; whereso should be a bareword. use warnings; no warnings 'experimental::smartmatch'; print STDOUT whereso; EXPECT Unquoted string "whereso" may clash with future reserved word at - line 3. whereso ######## # No switch; but continue is still a keyword print STDOUT continue; EXPECT Can't "continue" outside a whereso block at - line 2. ######## # Use switch; so given is a keyword use feature 'switch'; no warnings 'experimental::smartmatch'; given("okay\n") { print } EXPECT okay ######## # Use switch; so whereso is a keyword use feature 'switch'; no warnings 'experimental::smartmatch'; given(1) { whereso(1) { print "okay" } } EXPECT okay ######## # switch out of scope; given should be a bareword. use warnings; no warnings 'experimental::smartmatch'; { use feature 'switch'; given (1) {print "Okay here\n";} } print STDOUT given; EXPECT Unquoted string "given" may clash with future reserved word at - line 6. Okay here given ######## # switch out of scope; whereso should be a bareword. use warnings; no warnings 'experimental::smartmatch'; { use feature 'switch'; given (1) { whereso(1) {print "Okay here\n";} } } print STDOUT whereso; EXPECT Unquoted string "whereso" may clash with future reserved word at - line 6. Okay here whereso ######## # C should work use warnings; no warnings 'experimental::smartmatch'; use feature 'switch'; given (1) { whereso(1) {print "Okay here\n";} } no feature 'switch'; print STDOUT whereso; EXPECT Unquoted string "whereso" may clash with future reserved word at - line 6. Okay here whereso ######## # C should work too use warnings; no warnings 'experimental::smartmatch'; use feature 'switch'; given (1) { whereso(1) {print "Okay here\n";} } no feature; print STDOUT whereso; EXPECT Unquoted string "whereso" may clash with future reserved word at - line 6. Okay here whereso