develooper Front page | perl.perl5.porters | Postings from March 2006

Re: how should %^H work with lexical pramas

Thread Previous | Thread Next
From:
David Nicol
Date:
March 30, 2006 11:20
Subject:
Re: how should %^H work with lexical pramas
Message ID:
934f64a20603301120q7b3206a6lc830db1951faea18@mail.gmail.com
On 3/30/06, David Nicol <davidnicol@gmail.com> wrote:
>
> So what do you do when you want to effect a global change to a hint?


  our $top_level_hint_ref = \%^H;
  $^H{flubber} = 1;
  {
        is($^H{flubber},1);
        $^H{flubber} = 3;
        $top_level_hint_ref->{flubber} = 2
        is($^H{flubber},3);
  }
 is($^H{flubber},2);


(by the way, does one of the devel:: modules expose a perl-level way to
 add code to the "do-this-on-scope-teardown" list?)

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