Path: csiph.com!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Uri Guttman Newsgroups: comp.lang.perl.misc Subject: Re: Embedding code in qq{}? Date: Mon, 19 Mar 2012 00:14:51 -0400 Organization: albasani.net Lines: 37 Message-ID: <878vixtef8.fsf@stemsystems.com> References: <87limyk471.fsf@Gmail.com> <1fjg39-qnv2.ln1@anubis.morrow.me.uk> <86fwd5wl9d.fsf@red.stonehenge.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.albasani.net zmyvKZonKSUuIlNLr05PCPrEjRR3z4GmrwOwlxzBw9V7cJcit5i+C38WUTNK/hkaNzgyAzyaZSUDD5U7zr7EfN4VLhOuNJaXNgOIguFb9XGHWk1OItHdZIhV9bc9K3aL NNTP-Posting-Date: Mon, 19 Mar 2012 04:15:34 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="49LeZnDiN55ybctWACyz40wWa3atgfjST21ORug9MyOiJ3oATDwjRxOibtKx2xyAmmlCmrhjvZNKtuXy03kq3cm3qxGNsRoLwVBZ4W+bZkQGBARqW0+inDI7vOoUqMOk"; mail-complaints-to="abuse@albasani.net" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:9L8A/h7eXfox9fvK8uFObCSCsDU= sha1:QVJPcoZwR8NOYAWbxLXTFkSPBoY= Xref: csiph.com comp.lang.perl.misc:4804 >>>>> "TM" == Tim McDaniel writes: TM> In article <86fwd5wl9d.fsf@red.stonehenge.com>, TM> Randal L. Schwartz wrote: >>>>>>> "Tim" == Tim McDaniel writes: >> Tim> print "scalar: ", ${tester()}, "\n"; >> >> I'm amazed this works. TM> Why? The basic syntax for a scalar variable is $identifier, and man TM> perlref (Perl 5.10): please put your sarcasm detector on high gain. do you realize who you replied to? Tim> print "array: ", @{tester()}, "\n"; >> >> You forgot the square brackets. TM> No, I didn't. They are not required -- just a BLOCK that returns a TM> reference to an array. Of course, square brackets are a convenient TM> way to generate such a reference. Had tester been called in an array TM> context (which, as I noted, in retrospect would make no sense), it TM> would have returned [ 11, 12, 13 ]. without the [] it isn't close to the idiom being discussed. and as i mentioned it wasn't in "" so it really bypasses the idiom. a plain deref is just a plain deref, nothing to jump up and down about. TM> I just ran this in Perl 5.10: TM> In the "pondering" case, nary a square bracket in sight. you are wandering in the wilderness. please go home! :) uri