develooper Front page | perl.perl5.porters | Postings from January 2008

Re: [perl #45627] CHECK{}, INIT{} in sitecustomize.pl

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
January 6, 2008 08:37
Subject:
Re: [perl #45627] CHECK{}, INIT{} in sitecustomize.pl
Message ID:
b77c1dce0801060837k36421d26va0605302e3f46039@mail.gmail.com
On 21/09/2007, via RT Peter Dintelmann <perlbug-followup@perl.org> wrote:
> This is a bug report for perl from Peter.Dintelmann@dresdner-bank.com,
> generated with the help of perlbug 1.36 running under perl 5.10.0.
>
> CHECK and INIT blocks in sitecustomize.pl
> seem to be executed after runtime.
>
>     $ cat /opt/perl32blead/lib/site_perl/5.10.0/sitecustomize.pl
>     BEGIN  { warn "begin\n" }
>     INIT   { warn "init\n"  }
>     CHECK  { warn "check\n" }
>     END    { warn "end\n"   }
>     warn "run\n";
>
>     $ /opt/perl32blead/bin/perl5.10.0 -e1
>     begin
>     run
>     check
>     init
>     end

That's because sitecustomize.pl is executed from inside a BEGIN block,
which I documented a bit better in change #32875.

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