*/
if (!method && (GvCVGEN(gv) || GvSTASH(gv) != stash)
)
- Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED),
- "Use of inherited AUTOLOAD for non-method %s::%.*s() is deprecated",
- packname, (int)len, name);
+ Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
+ "Use of inherited AUTOLOAD for non-method %s::%.*s() is deprecated",
+ packname, (int)len, name);
if (CvISXSUB(cv)) {
/* rather than lookup/init $AUTOLOAD here
shortcut macro defined without -DPERL_CORE. Neither codesearch.google.com nor
CPAN::Unpack show any users outside the core. */
#ifdef PERL_CORE
-# define deprecate(s) Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED), "Use of " s " is deprecated")
+# define deprecate(s) Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED), "Use of " s " is deprecated")
#endif
/*
&& o2->op_private & OPpLVAL_INTRO
&& !(o2->op_private & OPpPAD_STATE))
{
- Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED),
- "Deprecated use of my() in false conditional");
+ Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
+ "Deprecated use of my() in false conditional");
}
*otherp = NULL;
return o;
}
else if ((o->op_type == OP_RV2AV || o->op_type == OP_PADAV)) {
- Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED),
+ Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
"Using an array as a reference is deprecated");
}
return newUNOP(OP_RV2AV, 0, scalar(o));
return o;
}
else if ((o->op_type == OP_RV2HV || o->op_type == OP_PADHV)) {
- Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED),
+ Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
"Using a hash as a reference is deprecated");
}
return newUNOP(OP_RV2HV, 0, scalar(o));
{
OP * const newop = newAVREF(newGVOP(OP_GV, 0,
gv_fetchsv(((SVOP*)kid)->op_sv, GV_ADD, SVt_PVAV) ));
- Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED),
+ Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
"Array @%"SVf" missing the @ in argument %"IVdf" of %s()",
SVfARG(((SVOP*)kid)->op_sv), (IV)numargs, PL_op_desc[type]);
#ifdef PERL_MAD
{
OP * const newop = newHVREF(newGVOP(OP_GV, 0,
gv_fetchsv(((SVOP*)kid)->op_sv, GV_ADD, SVt_PVHV) ));
- Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED),
+ Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
"Hash %%%"SVf" missing the %% in argument %"IVdf" of %s()",
SVfARG(((SVOP*)kid)->op_sv), (IV)numargs, PL_op_desc[type]);
#ifdef PERL_MAD
break; /* Globals via GV can be undef */
case OP_PADAV:
case OP_AASSIGN: /* Is this a good idea? */
- Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED),
+ Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
"defined(@array) is deprecated");
- Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED),
+ Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
"\t(Maybe you should just omit the defined()?)\n");
break;
case OP_RV2HV:
*/
break; /* Globals via GV can be undef */
case OP_PADHV:
- Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED),
+ Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
"defined(%%hash) is deprecated");
- Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED),
+ Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
"\t(Maybe you should just omit the defined()?)\n");
break;
default:
desperation):
(W) A warning (optional).
- (D) A deprecation (optional).
+ (D) A deprecation (enabled by default).
(S) A severe warning (enabled by default).
(F) A fatal error (trappable).
(P) An internal error you should never see (trappable).
=item $* is no longer supported
-(S deprecated, syntax) The special variable C<$*>, deprecated in older perls, has
+(D deprecated, syntax) The special variable C<$*>, deprecated in older perls, has
been removed as of 5.9.0 and is no longer supported. In previous versions of perl the use of
C<$*> enabled or disabled multi-line matching within a string.
=item $# is no longer supported
-(S deprecated, syntax) The special variable C<$#>, deprecated in older perls, has
+(D deprecated, syntax) The special variable C<$#>, deprecated in older perls, has
been removed as of 5.9.3 and is no longer supported. You should use the
printf/sprintf functions instead.
As of release 5 of Perl, assignment to C<$[> is treated as a compiler
directive, and cannot influence the behavior of any other file.
(That's why you can only assign compile-time constants to it.) Its
-use is deprecated, and will trigger a warning (if the deprecation
-L<warnings> category is enabled. You did C<use warnings>, right?)
+use is deprecated, and by default will trigger a warning.
Note that, unlike other compile-time directives (such as L<strict>),
assignment to C<$[> can be seen from outer lexical scopes in the same file.
IoFLAGS(GvIOp(gv)) &= ~IOf_UNTAINT;
if (IoDIRP(io))
- Perl_ck_warner(aTHX_ packWARN2(WARN_IO, WARN_DEPRECATED),
- "Opening dirhandle %s also as a file", GvENAME(gv));
+ Perl_ck_warner_d(aTHX_ packWARN2(WARN_IO, WARN_DEPRECATED),
+ "Opening dirhandle %s also as a file",
+ GvENAME(gv));
mg = SvTIED_mg((const SV *)io, PERL_MAGIC_tiedscalar);
if (mg) {
goto nope;
if ((IoIFP(io) || IoOFP(io)))
- Perl_ck_warner(aTHX_ packWARN2(WARN_IO, WARN_DEPRECATED),
- "Opening filehandle %s also as a directory", GvENAME(gv));
+ Perl_ck_warner_d(aTHX_ packWARN2(WARN_IO, WARN_DEPRECATED),
+ "Opening filehandle %s also as a directory",
+ GvENAME(gv));
if (IoDIRP(io))
PerlDir_close(IoDIRP(io));
if (!(IoDIRP(io) = PerlDir_open(dirname)))
#define ckWARNregdep(loc,m) STMT_START { \
const IV offset = loc - RExC_precomp; \
- Perl_ck_warner(aTHX_ packWARN2(WARN_DEPRECATED, WARN_REGEXP), \
+ Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED, WARN_REGEXP), \
m REPORT_LOCATION, \
(int)offset, RExC_precomp, RExC_precomp + offset); \
} STMT_END
Found = in conditional, should be == at - line 3.
########
# op.c
-use warnings 'deprecated';
my (@foo, %foo);
%main::foo->{"bar"};
%foo->{"bar"};
$main::foo = []; @$main::foo->[34];
$foo = []; @$foo->[34];
EXPECT
+Using a hash as a reference is deprecated at - line 3.
Using a hash as a reference is deprecated at - line 4.
-Using a hash as a reference is deprecated at - line 5.
+Using an array as a reference is deprecated at - line 5.
Using an array as a reference is deprecated at - line 6.
-Using an array as a reference is deprecated at - line 7.
+Using a hash as a reference is deprecated at - line 7.
Using a hash as a reference is deprecated at - line 8.
-Using a hash as a reference is deprecated at - line 9.
+Using an array as a reference is deprecated at - line 9.
Using an array as a reference is deprecated at - line 10.
-Using an array as a reference is deprecated at - line 11.
########
# op.c
use warnings 'void' ; close STDIN ;
Format FRED redefined at - line 5.
########
# op.c
-use warnings 'deprecated' ;
push FRED;
no warnings 'deprecated' ;
push FRED;
EXPECT
-Array @FRED missing the @ in argument 1 of push() at - line 3.
+Array @FRED missing the @ in argument 1 of push() at - line 2.
########
# op.c
-use warnings 'deprecated' ;
@a = keys FRED ;
no warnings 'deprecated' ;
@a = keys FRED ;
EXPECT
-Hash %FRED missing the % in argument 1 of keys() at - line 3.
+Hash %FRED missing the % in argument 1 of keys() at - line 2.
########
# op.c
use warnings 'syntax' ;
(Maybe you meant system() when you said exec()?)
########
# op.c
-use warnings 'deprecated' ;
my @a; defined(@a);
EXPECT
-defined(@array) is deprecated at - line 3.
+defined(@array) is deprecated at - line 2.
(Maybe you should just omit the defined()?)
########
# op.c
-use warnings 'deprecated' ;
defined(@a = (1,2,3));
EXPECT
-defined(@array) is deprecated at - line 3.
+defined(@array) is deprecated at - line 2.
(Maybe you should just omit the defined()?)
########
# op.c
-use warnings 'deprecated' ;
my %h; defined(%h);
EXPECT
-defined(%hash) is deprecated at - line 3.
+defined(%hash) is deprecated at - line 2.
(Maybe you should just omit the defined()?)
########
# op.c
Useless localization of vec at - line 50.
########
# op.c
-use warnings 'deprecated';
my $x1 if 0;
my @x2 if 0;
my %x3 if 0;
if ($a && (my $w3 = 1)) {$a = 2}
EXPECT
+Deprecated use of my() in false conditional at - line 2.
Deprecated use of my() in false conditional at - line 3.
Deprecated use of my() in false conditional at - line 4.
Deprecated use of my() in false conditional at - line 5.
Deprecated use of my() in false conditional at - line 6.
Deprecated use of my() in false conditional at - line 7.
Deprecated use of my() in false conditional at - line 8.
-Deprecated use of my() in false conditional at - line 9.
########
# op.c
$[ = 1;
no warnings 'deprecated';
$[ = 3;
EXPECT
+Use of assignment to $[ is deprecated at - line 2.
Use of assignment to $[ is deprecated at - line 4.
__END__
# toke.c
-use warnings 'deprecated' ;
format STDOUT =
@<<< @||| @>>> @>>>
$a $b "abc" 'def'
$a $b "abc" 'def'
.
EXPECT
-Use of comma-less variable list is deprecated at - line 5.
-Use of comma-less variable list is deprecated at - line 5.
-Use of comma-less variable list is deprecated at - line 5.
+Use of comma-less variable list is deprecated at - line 4.
+Use of comma-less variable list is deprecated at - line 4.
+Use of comma-less variable list is deprecated at - line 4.
########
# toke.c
-use warnings 'deprecated' ;
$a = <<;
no warnings 'deprecated' ;
$a = <<;
EXPECT
-Use of bare << to mean <<"" is deprecated at - line 3.
+Use of bare << to mean <<"" is deprecated at - line 2.
########
# toke.c
use warnings 'syntax' ;
}
sub whack_eth ($) : locked {
}
-use warnings 'deprecated';
+no warnings 'deprecated';
our $bar :unique;
sub zapeth :locked;
sub ker_plop :locked {
sub swa_a_p ($) : locked {
}
EXPECT
-Use of :unique is deprecated at - line 9.
-Use of :locked is deprecated at - line 10.
-Use of :locked is deprecated at - line 11.
-Use of :locked is deprecated at - line 13.
+Use of :unique is deprecated at - line 2.
+Use of :locked is deprecated at - line 3.
+Use of :locked is deprecated at - line 4.
+Use of :locked is deprecated at - line 6.
########
# toke.c
use warnings "syntax";