Aaron Sherman writes:
> Among the various ways of declaring variables, will Perl 6 have a way to
> say, "this variable is highly temporary, and may be re-declared within
> the same scope, or in a nested scope without concern"? I often find
> myself doing:
>
> my $sql = q{...};
> ...do some DB stuff...
> my $sql = q{...};
> ...do more DB stuff...
There's a pretty common idiom for this:
{
my $sql = q{...};
# ... do some DB stuff ...
}
{
my $sql = q{...};
# ... do more DB stuff ...
}
You see it in test suites all over the CPANdom.
Luke