Patch for keys(), each(), and values()

[email protected] ("Glenn King") Sun, 4 Aug 2002 10:13:37 -0500
Newsgroups perl.perl1.porters
Message-ID <00b901c23bc9$82284e20$0701a8c0@wdev01>
------=_NextPart_000_00B5_01C23B9F.98FB2570
Content-Type: multipart/alternative;
	boundary="----=_NextPart_001_00B6_01C23B9F.98FB2570"


------=_NextPart_001_00B6_01C23B9F.98FB2570
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Just for my own sanity.  Makes them act perl perl5ish.

ex

keys(%ENV)=20

instead of

keys(ENV) # YUCK


t/op.each was updated accordingly

------=_NextPart_001_00B6_01C23B9F.98FB2570
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Just for my own sanity.&nbsp; Makes =
them act perl=20
perl5ish.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>ex</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>keys(%ENV) </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>instead of</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>keys(ENV) # YUCK</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>t/op.each was updated=20
accordingly</FONT></DIV></BODY></HTML>

------=_NextPart_001_00B6_01C23B9F.98FB2570--

------=_NextPart_000_00B5_01C23B9F.98FB2570
Content-Type: application/octet-stream;
	name="hasharg.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="hasharg.patch"

diff -ru perl1.010/perl.y perl1.010-hacks/perl.y=0A=
--- perl1.010/perl.y	Sun Aug  4 09:03:44 2002=0A=
+++ perl1.010-hacks/perl.y	Sun Aug  4 02:13:31 2002=0A=
@@ -565,9 +565,9 @@=0A=
 			{ $$ =3D make_op($1, 2, $3, $5, Nullarg, 0); }=0A=
 	|	FUNC3 '(' sexpr ',' sexpr ',' expr ')'=0A=
 			{ $$ =3D make_op($1, 3, $3, $5, $7, 0); }=0A=
-	|	STABFUN '(' WORD ')'=0A=
+	|	STABFUN '(' '%' WORD ')'=0A=
 			{ $$ =3D make_op($1, 1,=0A=
-				stab_to_arg(A_STAB,hadd(stabent($3,TRUE))),=0A=
+				stab_to_arg(A_STAB,hadd(stabent($4,TRUE))),=0A=
 				Nullarg,=0A=
 				Nullarg, 0); }=0A=
 	;=0A=
diff -ru perl1.010/t/op.each perl1.010-hacks/t/op.each=0A=
--- perl1.010/t/op.each	Sun Aug  4 09:03:53 2002=0A=
+++ perl1.010-hacks/t/op.each	Sun Aug  4 08:59:59 2002=0A=
@@ -35,12 +35,12 @@=0A=
 $h{'y'} =3D 'Y';=0A=
 $h{'z'} =3D 'Z';=0A=
 =0A=
-@keys =3D keys(h);=0A=
-@values =3D values(h);=0A=
+@keys =3D keys(%h);=0A=
+@values =3D values(%h);=0A=
 =0A=
 if ($#keys =3D=3D 29 && $#values =3D=3D 29) {print "ok 1\n";} else =
{print "not ok 1\n";}=0A=
 =0A=
-while (($key,$value) =3D each(h)) {=0A=
+while (($key,$value) =3D each(%h)) {=0A=
     if ($key eq $keys[$i] && $value eq $values[$i] && $key gt $value) {=0A=
 	$key =3D~ y/a-z/A-Z/;=0A=
 	$i++ if $key eq $value;=0A=

------=_NextPart_000_00B5_01C23B9F.98FB2570--