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

Re: A user pragma example

Thread Previous | Thread Next
Rafael Garcia-Suarez
March 31, 2006 15:22
Re: A user pragma example
Message ID:
On 4/1/06, Rafael Garcia-Suarez <> 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About