diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 2b26514f8bca..c2cec95349dc 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -44,6 +44,12 @@ letter. =over 4 +=item __CLASS__ is experimental + +(S experimental::class) This warning is emitted if you use the C<__CLASS__> +keyword of C. This keyword is currently +experimental and its behaviour may change in future releases of Perl. + =item accept() on closed socket %s (W closed) You tried to do an accept on a closed socket. Did you forget diff --git a/toke.c b/toke.c index 6f292d617628..7e5907082ed2 100644 --- a/toke.c +++ b/toke.c @@ -8003,6 +8003,8 @@ yyl_word_or_keyword(pTHX_ char *s, STRLEN len, I32 key, I32 orig_keyword, struct : newSVOP(OP_RUNCV, 0, &PL_sv_undef)); case KEY___CLASS__: + Perl_ck_warner_d(aTHX_ + packWARN(WARN_EXPERIMENTAL__CLASS), "__CLASS__ is experimental"); FUN0(OP_CLASSNAME); case KEY_AUTOLOAD: