Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!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.213652.28455@iwarp.intel.com> Date: 6 Mar 90 21:36:52 GMT References: <1211@frankland-river.aaii.oz.au> <7269@jpl-devvax.JPL.NASA.GOV> <21611@watdragon.waterloo.edu> <1990Mar6.180823.27618@iwarp.intel.com> <7294@jpl-devvax.JPL.NASA.GOV> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 24 In-Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) In article <7294@jpl-devvax.JPL.NASA.GOV>, lwall@jpl-devvax (Larry Wall) writes: | ( LIST ) [ EXPR ] | | Since LISTs can contain anything that returns array values, you could say | | $time = (stat($file))[8]; | | That could be parsed unambiguously, methinks. | | It would in fact be a slice operator, so you could say | | @days = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat')[$beg .. $end]; | | What think? Yeah, yeah, yeah. Supercool! I'm thinking of how to use that in my signatures already! :-) print $_ x (($_ = "just another Perl hacker,") =~ s/j/J/); -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/