One further worry of mine concerns the action of %MY:: on unintroduced
variables (especially the action of delete).

my $x = 100;
{
    my $x = (%MY::{'$x'} = \200, $x+1);
    print "inner=$x, ";
}
print "outer=$x";

I'm guessing this prints inner=201, outer=200

As for

my $x = 50;
{
    my $x = 100;
    {
        my $x = (delete %MY::{'$x'}, $x+1);
        print "inner=$x, ";
    }
    print "middle=$x, ";
}
print "outer=$x";

If delete 'reexposes' an outer version of that variable, then I'd speculate
the output would be

inner=51, middle=50, outer=50

Reply via email to