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

Re: A user pragma example

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
March 31, 2006 15:22
Subject:
Re: A user pragma example
Message ID:
b77c1dce0603311522g5a7e8cefs9306b9cc39b953d4@mail.gmail.com
On 4/1/06, Rafael Garcia-Suarez <rgarciasuarez@gmail.com> wrote:
> sub import {
>     $^H{mypragma} = 1;
> }

Correction : You need this in import() too :
   $^H |= 0x00020000;
this makes perl properly restore %^H at scope exit during compilation.

Although without this line, my test file still works.
If you add at the end of the test file :
BEGIN { print $^H{mypragma} }
you'll see that $^H{mypragma} wasn't restored there.

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