Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!convex!news From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.lang.perl Subject: Re: fun with scoping Message-ID: <1990Dec21.112048.28574@convex.com> Date: 21 Dec 90 11:20:48 GMT References: <111557@convex.convex.com> <1990Dec18.220515.19336@convex.com> Sender: news@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 38 Nntp-Posting-Host: pixel.convex.com From the keyboard of tchrist@convex.COM (Tom Christiansen): :Now answer me these questions three: (Before I jump on the plane to head for True Cold, here are some answers...) : 1. Why is this (or isn't this) a recursive program? It isn't -- the *id pass-by-name assignment in &id changes which &id your talking about. [Someone was explaining to me the difference between pass-by-name and pass-by-reference, and perl's style seems more the former than the latter.] If you considereed the *id assignment some kind of funky conditional, I guess you might possibly construe it to be a potentially recursive program, but that would be stretching it, and anyway, in this case it doesn't do that. : 2. What are the associative arrays in this program, by name? There are 2 associative arrays used to cache names and values. These are %group and %login. However, to the program, they are always known as %id, but which one it means varies between calls, so it would be arguably correct (and certainly a lot more fun) to say that they are %id and %id. : 3. What are their favorite colors? One respondent said "Red. No Blue!" His message trailed off in an "ARGGGGGGGGGGGGGGGGG!" as he was cast in the Abyss, and I have not heard from him since. You should always answer Blue to questions like this, or at the very least be decisive. --tom -- Tom Christiansen tchrist@convex.com convex!tchrist "With a kernel dive, all things are possible, but it sure makes it hard to look at yourself in the mirror the next morning." -me