Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!stanford.edu!agate!usenet.ins.cwru.edu!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery KF8NH) Newsgroups: comp.lang.perl Subject: Re: A question on associative arrays Message-ID: <1991Jun3.230111.8818@NCoast.ORG> Date: 3 Jun 91 23:01:11 GMT References: <1991May30.205555.14490@convex.com> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery KF8NH) Followup-To: comp.lang.perl Organization: North Coast Public Access Un*x (ncoast) Lines: 21 As quoted from <1991May30.205555.14490@convex.com> by Tom Christiansen : +--------------- | if (%a) { | | will actually work, but I don't think that Larry has ever documented | this. More portably, and more slowly would be +--------------- Not in so many words he hasn't, but %a has an array value, and therefore has a scalar value (the number of elements in the array generated by %a in an array context). Note that %a will be *twice* the number of entries in the assoc array, since it is a list of keys *and* values. ...but it occurs to me that %a in either context will not do what you expect if %a has been bound to a dbm file. Ooooops. ++Brandon -- Me: Brandon S. Allbery KF8NH: DC to LIGHT! [44.70.4.88] Internet: allbery@NCoast.ORG Delphi: ALLBERY uunet!usenet.ins.cwru.edu!ncoast!allbery