[ List each enhancement as a =head2 entry ]
+=head2 C<CORE::> works on all keywords
+
+The C<CORE::> prefix can now be used on keywords enabled by
+L<feature.pm|feature>, even outside the scope of C<use feature>.
+
=head1 Security
XXX Any security-related notices go here. In particular, any security
}
use strict;
+
+plan tests => 131;
+
+# Before loading feature.pm, test it with CORE::
+ok eval 'CORE::state $x = 1;', 'CORE::state outside of feature.pm scope';
+
+
use feature ":5.10";
-plan tests => 130;
ok( ! defined state $uninit, q(state vars are undef by default) );
use strict;
use warnings;
-plan tests => 166;
+plan tests => 168;
# The behaviour of the feature pragma should be tested by lib/feature.t
# using the tests in t/lib/feature/*. This file tests the behaviour of
# the switch ops themselves.
+
+# Before loading feature, test the switch ops with CORE::
+CORE::given(3) {
+ CORE::when(3) { pass "CORE::given and CORE::when"; CORE::continue }
+ CORE::default { pass "CORE::continue and CORE::default" }
+}
+
+
use feature 'switch';
eval { continue };
s += 2;
d = s;
s = scan_word(s, PL_tokenbuf, sizeof PL_tokenbuf, FALSE, &len);
- if (!(tmp = keyword(PL_tokenbuf, len, 0)))
+ if (!(tmp = keyword(PL_tokenbuf, len, 1)))
Perl_croak(aTHX_ "CORE::%s is not a keyword", PL_tokenbuf);
if (tmp < 0)
tmp = -tmp;
- else if (tmp == KEY_require || tmp == KEY_do)
+ if (tmp == KEY_require || tmp == KEY_do ||
+ tmp == KEY_continue)
/* that's a way to remember we saw "CORE::" */
orig_keyword = tmp;
goto reserved_word;
UNI(OP_CHOP);
case KEY_continue:
- /* When 'use switch' is in effect, continue has a dual
+ /* When 'use switch' is in effect or when
+ prefixed with CORE::, continue has a dual
life as a control operator. */
{
- if (!FEATURE_IS_ENABLED("switch"))
+ if ( !FEATURE_IS_ENABLED("switch")
+ && orig_keyword != KEY_continue )
PREBLOCK(CONTINUE);
else {
/* We have to disambiguate the two senses of