develooper Front page | perl.perl5.porters | Postings from November 2010

Re: [perl #79828] STDERR isn't being unlocalized when there's anunhandled exception.

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
November 27, 2010 10:36
Subject:
Re: [perl #79828] STDERR isn't being unlocalized when there's anunhandled exception.
Message ID:
AANLkTi=C3vhXSFcDaKqdD8Jx-1vhn9_D1HvrtAy_9y-9@mail.gmail.com
On 26 November 2010 19:31, Elliot Shank <perlbug-followup@perl.org> wrote:
> STDERR isn't being unlocalized when there's an unhandled exception.  For
> example,
>
>     perl -E 'open my $h, ">", \$string; local *STDERR = $h; die "blah"'
>
> doesn't emit anything.  That's global scope you say?  The following shows the
> same problem:
>
>     sub foo {
>         die q<why doesn't this show up?>;
>     }
>
>     sub bar {
>         my $x;
>         open my $h, '>', \$x;
>         local *STDERR = $h;
>         foo();
>     }
>
>     bar();
>
> I expect STDERR to be delocalized before final exeption handling kicks in.
> It's as if the lexical scope isn't being left.

Not a bug, in my opinion (local() being dynamic scoping, not lexical scoping).

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About