Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!brutus.cs.uiuc.edu!psuvax1!news From: flee@shire.cs.psu.edu (Felix Lee) Newsgroups: comp.lang.perl Subject: Re: any chance of real multi-dimensional arrays? Message-ID: Date: 21 Feb 90 15:18:02 GMT References: <1990Feb20.225434.2045@athena.mit.edu> <100127@convex.convex.com> Sender: news@cs.psu.edu (Usenet) Distribution: usa Organization: Penn State University Computer Science Lines: 17 Tom Christiansen wrote: >The problem I see with doing multi-dimensional arrays the way you've >said them is growing both indices dynamically. You promote lists to first-class objects and let lists contain lists: @a = (1, (2, 3), (4, 5)); And similarly with associations: %a{'rgb'} = ('red', 1, 'green', 2, 'blue', 3); Except Perl's syntax makes this a little strange. Compare $b{'rgb'} = ('red', 1, 'green', 2, 'blue', 3); It's ($a{'rgb'}{'red'} == 1), but ($b{'rgb'}[1] == 1). At least, that's what I think. Perl's use of % $ and @ is pretty bizarre. And associations really shouldn't get confused with lists. Non-trivial change to Perl. Version 4? -- Felix Lee flee@shire.cs.psu.edu *!psuvax1!flee