Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!bywater!arnor!arnor!victor From: victor@arnor.uucp Newsgroups: comp.lang.perl Subject: apply in Perl? Message-ID: Date: 13 Feb 91 16:21:03 GMT Sender: news@arnor.uucp (NNTP News Poster) Reply-To: victor@ibm.com Distribution: comp Organization: IBM, T.J. Watson Research Center Lines: 15 Is there something like the lisp apply in perl? It seems like the function grep is almost there. For example, suppose that I want to produce an array like the following: foreach (1..$limit) {$a[$_ -1] = "foobar.$f";} Of course I'd like to produce this array without giving it a name. It seems that grep("foobar.$f",(1..$limit)) actually evaluates these things, and then throws them away. Is there some hack to use grep (or maybe something else) to actually produce the array? -- Victor S. Miller Vnet and Bitnet: VICTOR at WATSON Internet: victor@ibm.com IBM, TJ Watson Research Center