Adrian M. Enache [Thu, 17 Apr 2003 14:35:36 +0000 (17:35 +0300)]
Message-Id: <
20030417113536.GA898@ratsnest.hole>
p4raw-id: //depot/perl@19247
else {
s->var = newSVpvn("", 0);
}
- sv_upgrade(s->var, SVt_PV);
+ SvUPGRADE(s->var, SVt_PV);
code = PerlIOBase_pushed(aTHX_ f, mode, Nullsv, tab);
if ((PerlIOBase(f)->flags) & PERLIO_F_TRUNCATE)
SvCUR(s->var) = 0;
}
$| = 1;
-print "1..23\n";
+print "1..24\n";
my $fh;
my $var = "ok 2\n";
open $fh, '<', \42;
print <$fh> eq "42" ? "ok 23\n" : "not ok 23\n";
close $fh;
+
+# reading from magic scalars
+
+{ package P; sub TIESCALAR {bless{}} sub FETCH {"ok 24\n"} }
+tie $p, P; open $fh, '<', \$p;
+print <$fh>;