From: "H.Merijn Brand" <h.m.brand@hccnet.nl>
Subject: Re: Looking for a starting point (Mark-Jason?, Chip?, Jarkko?)
Date: Wed, 26 Jul 2000 19:51:02 +0200
Message-Id: <
20000726194952.41DD.H.M.BRAND@hccnet.nl>
From: Graham Barr <gbarr@pobox.com>
Subject: Re: Looking for a starting point (Mark-Jason?, Chip?, Jarkko?)
Date: Wed, 26 Jul 2000 17:38:36 +0100
Message-ID: <
20000726173836.L472@pobox.com>
p4raw-id: //depot/perl@6445
case 'F':
if (strEQ(elem, "FILEHANDLE")) /* XXX deprecate in 5.005 */
tmpRef = (SV*)GvIOp(gv);
+ else
+ if (strEQ(elem, "FORMAT"))
+ tmpRef = (SV*)GvFORM(gv);
break;
case 'G':
if (strEQ(elem, "GLOB"))
dref = (SV*)GvIOp(dstr);
GvIOp(dstr) = (IO*)sref;
break;
+ case SVt_PVFM:
+ if (intro)
+ SAVESPTR(GvFORM(dstr));
+ else
+ dref = (SV*)GvFORM(dstr);
+ GvFORM(dstr) = (CV*)sref;
+ break;
default:
if (intro)
SAVESPTR(GvSV(dstr));
use warnings;
-print "1..40\n";
+print "1..41\n";
# type coersion on assignment
$foo = 'foo';
%x = ("ok 19" => "\n");
sub x { "ok 20\n" }
print ${*x{SCALAR}}, @{*x{ARRAY}}, %{*x{HASH}}, &{*x{CODE}};
+format x =
+ok 21
+.
+print ref *x{FORMAT} eq "FORMAT" ? "ok 21\n" : "not ok 21\n";
*x = *STDOUT;
-print *{*x{GLOB}} eq "*main::STDOUT" ? "ok 21\n" : "not ok 21\n";
-print {*x{IO}} "ok 22\n";
-print {*x{FILEHANDLE}} "ok 23\n";
+print *{*x{GLOB}} eq "*main::STDOUT" ? "ok 22\n" : "not ok 22\n";
+print {*x{IO}} "ok 23\n";
+print {*x{FILEHANDLE}} "ok 24\n";
# test if defined() doesn't create any new symbols
{
- my $test = 23;
+ my $test = 24;
my $a = "SYM000";
print "not " if defined *{$a};
# although it *should* if you're talking about magicals
{
- my $test = 29;
+ my $test = 30;
my $a = "]";
print "not " unless defined ${$a};
}
__END__
-ok 40
+ok 41