Path: utzoo!mnetor!tmsoft!torsqnt!jarvis.csri.toronto.edu!cs.utexas.edu!usc!brutus.cs.uiuc.edu!apple!oliveb!orc!mipos3!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.lang.perl Subject: Re: Are only simple scalars allowed in "do SUBROUTINE (LIST)" ? Message-ID: <1990Mar6.180823.27618@iwarp.intel.com> Date: 6 Mar 90 18:08:23 GMT References: <1211@frankland-river.aaii.oz.au> <7269@jpl-devvax.JPL.NASA.GOV> <21611@watdragon.waterloo.edu> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 32 In-Reply-To: ccplumb@lion.waterloo.edu (Colin Plumb) In article <21611@watdragon.waterloo.edu>, ccplumb@lion (Colin Plumb) writes: | 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... I've stumbled across wanting such a syntax as well. I think it's the C programmer in me that would think it natural. I've held off asking for it because I'm afraid it would break something. Maybe in Perl 4? :-) Also, Colin, those last two lines should be: @stat = stat($file); $time = $stat[8]; open(C,"|uncompress");$_=<