$ perl -Mstrict -Mwarnings -e ' use 5.018; my sub z { say "In z()" } my ($x, $y) = (1, undef); given ($x) { when (1) { say "\$x == 1" } default { say "\$x != 1" } } given ($y) { when (1) { say "\$y == 1" } default { say "\$y != 1" } } z(); ' Experimental "my" subs not enabled at -e line 3.