/* On pushre, re is /\s+/ imp. by split " " */
/* On regcomp, "use re 'eval'" was in scope */
/* On OP_READLINE, was <$filehandle> */
+ /* On RV2[SG]V, don't create GV--in defined()*/
/* old names; don't use in new code, but don't break them, either */
#define OPf_LIST OPf_WANT_LIST
else {
dTOPss;
SV *targ = PAD_SV(PL_op->op_targ);
- int flip;
+ int flip = 0;
if (PL_op->op_private & OPpFLIP_LINENUM) {
- struct io *gp_io;
- flip = PL_last_in_gv
- && (gp_io = GvIO(PL_last_in_gv))
- && SvIV(sv) == (IV)IoLINES(gp_io);
+ if (GvIO(PL_last_in_gv)) {
+ flip = SvIV(sv) == (IV)IoLINES(GvIOp(PL_last_in_gv));
+ }
+ else {
+ GV *gv = gv_fetchpv(".", TRUE, SVt_PV);
+ if (gv && GvSV(gv)) flip = SvIV(sv) == SvIV(GvSV(gv));
+ }
} else {
flip = SvTRUE(sv);
}
else {
dTOPss;
SV *targ = PAD_SV(cUNOP->op_first->op_targ);
+ int flop = 0;
sv_inc(targ);
- if ((PL_op->op_private & OPpFLIP_LINENUM)
- ? (GvIO(PL_last_in_gv)
- && SvIV(sv) == (IV)IoLINES(GvIOp(PL_last_in_gv)))
- : SvTRUE(sv) ) {
+
+ if (PL_op->op_private & OPpFLIP_LINENUM) {
+ if (GvIO(PL_last_in_gv)) {
+ flop = SvIV(sv) == (IV)IoLINES(GvIOp(PL_last_in_gv));
+ }
+ else {
+ GV *gv = gv_fetchpv(".", TRUE, SVt_PV);
+ if (gv && GvSV(gv)) flop = SvIV(sv) == SvIV(GvSV(gv));
+ }
+ }
+ else {
+ flop = SvTRUE(sv);
+ }
+
+ if (flop) {
sv_setiv(PAD_SV(((UNOP*)cUNOP->op_first)->op_first->op_targ), 0);
sv_catpv(targ, "E0");
}
chdir 't' if -d 't';
-print "1..10\n";
+print "1..15\n";
@a = (1,2,3,4,5,6,7,8,9,10,11,12);
@a = ('a','b','c','d','e','f','g');
+{
+local $.;
+
open(of,'harness') or die "Can't open harness: $!";
while (<of>) {
(3 .. 5) && ($foo .= $_);
# coredump reported in bug 20001018.008
readline(UNKNOWN);
$. = 1;
- print "ok 10\n" unless 1 .. 10;
+ $x = 1..10;
+ print "ok 10\n";
+}
+
}
+
+if (!defined $.) { print "ok 11\n" } else { print "not ok 11 # $.\n" }
+
+use warnings;
+my $warn='';
+$SIG{__WARN__} = sub { $warn .= join '', @_ };
+
+if (0..2) { print "ok 12\n" } else { print "not ok 12\n" }
+
+if ($warn =~ /uninitialized/) { print "ok 13\n" } else { print "not ok 13\n" }
+$warn = '';
+
+$x = "foo".."bar";
+
+if ((() = ($warn =~ /isn't numeric/g)) == 2) {
+ print "ok 14\n"
+}
+else {
+ print "not ok 14\n"
+}
+$warn = '';
+
+$. = 15;
+if (15..0) { print "ok 15\n" } else { print "not ok 15\n" }