Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!caen!ox.com!ox.com!emv From: emv@ox.com (Ed Vielmetti) Newsgroups: comp.lang.perl Subject: what should length(@array) do ? Message-ID: Date: 10 Jan 91 02:17:27 GMT Sender: usenet@ox.com (Usenet News Administrator) Organization: OTA Limited Partnership, Ann Arbor MI. Lines: 24 I had some code that looked like body: { @obody = ; } which seemed to work just fine and quick too. Now I want to find out how many bytes are in this array. The obvious (?) solution to me was $obodylen = length(@obody); but that gets me "3", probably the size of some symbol table entry. The solution I now have does body: while () { push(@obody,$_) ; $obodylen += length($_); } seems to work fine, but in the tradition of perl hacking, there's probably a better way. --Ed emv@ox.com