for (kid = cUNOPo->op_first->op_sibling; kid; kid = kid->op_sibling)
scalar(kid);
break;
- case OP_SPLIT:
- if ((kid = cLISTOPo->op_first) && kid->op_type == OP_PUSHRE) {
- if (!kPMOP->op_pmreplrootu.op_pmreplroot)
- deprecate_old("implicit split to @_");
- }
/* FALL THROUGH */
+ case OP_SPLIT:
case OP_MATCH:
case OP_QR:
case OP_SUBST:
/* FALL THROUGH */
case OP_SCALAR:
return scalar(o);
- case OP_SPLIT:
- if ((kid = cLISTOPo->op_first) && kid->op_type == OP_PUSHRE) {
- if (!kPMOP->op_pmreplrootu.op_pmreplroot)
- deprecate_old("implicit split to @_");
- }
- break;
}
if (useless && ckWARN(WARN_VOID))
Perl_warner(aTHX_ packWARN(WARN_VOID), "Useless use of %s in void context", useless);
operator. Since C<split> always tries to match the pattern
repeatedly, the C</g> has no effect.
-=item Use of implicit split to @_ is deprecated
-
-(D deprecated, W syntax) It makes a lot of work for the compiler when you
-clobber a subroutine's argument list, so it's better if you assign the results
-of a split() explicitly to an array (or list).
-
=item Use of inherited AUTOLOAD for non-method %s() is deprecated
(D deprecated) As an (ahem) accidental feature, C<AUTOLOAD> subroutines
default, empty leading fields are preserved, and empty trailing ones are
deleted. (If all fields are empty, they are considered to be trailing.)
-In scalar context, returns the number of fields found. In scalar and void
-context it splits into the C<@_> array. Use of split in scalar and void
-context is deprecated, however, because it clobbers your subroutine
-arguments.
+In scalar context, returns the number of fields found.
If EXPR is omitted, splits the C<$_> string. If PATTERN is also omitted,
splits on whitespace (after skipping any leading whitespace). Anything
ary = GvAVn(pm->op_pmreplrootu.op_pmtargetgv);
}
#endif
- else if (gimme != G_ARRAY)
- ary = GvAVn(PL_defgv);
else
ary = NULL;
if (ary && (gimme != G_ARRAY || (pm->op_pmflags & PMf_ONCE))) {
Found = in conditional, should be ==
1 if $a = 1 ;
- Use of implicit split to @_ is deprecated
- split ;
-
- Use of implicit split to @_ is deprecated
- $a = split ;
-
Useless use of time in void context
Useless use of a variable in void context
Useless use of a constant in void context
Found = in conditional, should be == at - line 3.
########
# op.c
-use warnings 'deprecated' ;
-split ;
-no warnings 'deprecated' ;
-split ;
-EXPECT
-Use of implicit split to @_ is deprecated at - line 3.
-########
-# op.c
-use warnings 'deprecated' ;
-$a = split ;
-no warnings 'deprecated' ;
-$a = split ;
-EXPECT
-Use of implicit split to @_ is deprecated at - line 3.
-########
-# op.c
use warnings 'deprecated';
my (@foo, %foo);
%main::foo->{"bar"};
local $Message = "(??{ .. }) in split doesn't corrupt its stack";
our $i;
ok '-1-3-5-' eq join '', split /((??{$i++}))/, '-1-3-5-';
- no warnings 'deprecated', 'syntax';
- split /(?{'WOW'})/, 'abc';
+ no warnings 'syntax';
+ @_ = split /(?{'WOW'})/, 'abc';
local $" = "|";
iseq "@_", "a|b|c";
}
__END__
########
-$a = ":="; split /($a)/o, "a:=b:=c"; print "@_"
+$a = ":="; @_ = split /($a)/o, "a:=b:=c"; print "@_"
EXPECT
a := b := c
########
$s += $_} (1,2,4);
print "eat flaming death\n" unless ($s == 7);
########
-sub foo { local $_ = shift; split; @_ }
+sub foo { local $_ = shift; @_ = split; @_ }
@x = foo(' x y z ');
print "you die joe!\n" unless "@x" eq 'x y z';
########