>> But it *hasn't* left that scope: >> It is still within scope. > But it shouldn't be. Says who? Perl understands scopes perfectly well. sub foo { die q<why doesn't this show up?>; } sub bar { my $x; open my $h, '>', \$x; local *STDERR = $h; foo(); } bar(); At runtime: 1 main calls bar() 2 bar() sets stderr alias to last until bar's scope is over. 3 bar calls foo() 4 foo() calls die() 5 die() writes to stderr The bar() scope set up at 2 is *clearly* still extant at stage 5. Notice the indentation. There is no question that Perl is behaving per design and documentation. It may not be doing what *you* expect it to, but that is an entirely separate matter. --tomThread Previous | Thread Next