Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: any chance of real multi-dimensional arrays? Message-ID: <7125@jpl-devvax.JPL.NASA.GOV> Date: 21 Feb 90 18:26:55 GMT References: <1990Feb20.225434.2045@athena.mit.edu> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Distribution: usa Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 47 In article <1990Feb20.225434.2045@athena.mit.edu> ccount@athena.mit.edu (Craig A Counterman) writes: : Emulated multidimensional arrays are not intuitive. I.e. I haven't : been able to figure out how to do what I want with them. Is there any : chance of making '$var[2][0] = 3; $var[2][1] = 4; print $var[2];' do : the right thing? What's the right thing? What should be the value of $var[2]? "34"? "3 4"? Where did that space come from? What if one element had the value "the time" and the other element had the value "is now"? What is the interpretation of any of these? @foo = @var @foo[0..$#var] = @var[0..$#var] print @var; $var[2] = "the time is now"; It's can-of-worms time... : Also, since there are lists I'd also like the whole suite of Lisp : functions like 'mapcar'. Actually, I think most exist under other : names, e.g. it looks like 'grep' is actually 'mapcar' by another name. If : this is true, could lisp-ish names also be used, or at least : documented as such? Hmm. Usually people want me to turn perl into apl... You could certainly say something like #!/usr/bin/perl -P #define mapcar grep : And I'd like more stream input functions, like scanf or a 'get_word' : function. I've written the latter easily enough as a subroutine, but : still... I detest and abhor scanf. I always have. However, you should know that I'm strongly considering letting you do pattern matching against the input symbol: =~ /^pattern/; If you do this currently it will just read one line and pattern match on it. I'm considering making it read any extra lines it needs to satisfy the pattern match. Except that this could break existing scripts... Larry