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: Sun, 18 Mar 2012 15:24:28 -0400 Organization: albasani.net Lines: 19 Message-ID: <87ty1lu2z7.fsf@stemsystems.com> References: <87limyk471.fsf@Gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.albasani.net 8lNwBSV7BcCb4MsQ/BjXtq+HIm0cre75Si5Eu4Cktcdu9UviA69NXA8bT0pbKSMvO1chglrJVHp5otNOEGbEgvJnN1h0HHikxjhCvRls6nGb1vCxO+1rJsQEkj50jUip NNTP-Posting-Date: Sun, 18 Mar 2012 19:25:11 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="6UXdHWW2DIgqU2YF+8hvpzi5gIMV3CKicJXzwETQZhtWYCjkG9T954MxaOqz7krMY/ltYv1sZThL3pdbjaZoaDqOBnNjcHwphKgo/eXRaqKXOZxljfRrVspD02CXgtR8"; mail-complaints-to="abuse@albasani.net" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:3Ywxd7sfGXA3ThiyrsNY39Lof1w= sha1:2X54KXhZnK3qxOo0qECNIe4Bq+w= Xref: csiph.com comp.lang.perl.misc:4792 >>>>> "TM" == Tim McDaniel writes: TM> In article <87limyk471.fsf@Gmail.com>, XeCycle TM> wrote: >> Is it possible to use something like "${1+2}" -> "3"? TM> You made it clear in the rest of the article (which I trimmed) that TM> you were thinking about the right-hand side of a s///. It turns out TM> that, in string contexts in general, you can do it. TM> Short answer: TM> ${\(1+2)} bad answer. first off it isn't needed as the /e modifier to s/// does it. secondly it is a bad idea in general. the syntax for that is clunky and hard to read. yes, it is legal and works. i just never do it nor teach it to anyone. it is just poor coding IMNSHO. uri