Path: utzoo!utgpu!watserv1!watdragon!lion!ccplumb From: ccplumb@lion.waterloo.edu (Colin Plumb) Newsgroups: comp.lang.perl Subject: Re: Are only simple scalars allowed in "do SUBROUTINE (LIST)" ? Message-ID: <21611@watdragon.waterloo.edu> Date: 6 Mar 90 00:27:14 GMT References: <1211@frankland-river.aaii.oz.au> <7269@jpl-devvax.JPL.NASA.GOV> Sender: daemon@watdragon.waterloo.edu Reply-To: ccplumb@lion.waterloo.edu (Colin Plumb) Organization: U. of Waterloo, Ontario Lines: 21 In article <7269@jpl-devvax.JPL.NASA.GOV> lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) writes: > I also have people arguing for ('foo','bar')[$which]. Maybe. I'm not > done thinking about it. It's certainly more powerful to have [] and () > as first class operators, but I'm not sure that such conciseness is > always a virtue. Well, when I wanted the time from a file, the first thing I tried was $time = stat($file)[8]; It didn't work so well. Then I looked for prolog-style "dummy" assignments, as in (_,_,_,_,_,_,_,_,$time,_,_,_,_) = stat($file), and only after failing in that did I create all those icky dummy variables to hold the half of the stat array I don't care about. Now that I think of it, $stat = stat($file); $time = $stat[8]; might have been simpler... -- -Colin