> On 26 Oct 2020, at 18:40, Sean McAfee <eefacm@gmail.com> wrote: > Is this the intended behavior? The doc page on quoting constructs just says that values can be interpolated with braces, but (at least to my eyes) doesn't suggest that this involves creating a new scope, or a new function, or however it is that this happens. I guess we need to update the documentation. But the braces inside a double quoted string *do* create a new scope, causing the behaviour of ++$ that you have seen. > For my presentation I can just alter some lines to: > > say "You called me ", ++$times, " times"; > > and > > say "You called me ", ++$, " times"; > > ...but that seems a bit less elegant than what I had originally. Alternately you could do: say "You called me " ~ ++$ ~ " times"; Personally, I would avoid the use of the anonymous state variable. I think it is an example where Larry would nowadays apply rule #2. LizThread Previous | Thread Next