BEGIN <> BEGIN



Hi,

I understand that a "use <module> <vars>;" is similar to

BEGIN {
require <module>;
<module>->import(<args>);
}

When writing BEGIN blocks myself and looking at the
compiled script with B::Deparse, I can see my BEGIN
blocks, but not the BEGIN blocks created by "use".

Are these BEGIN blocks special in some way? Are
these actually BEGIN blocks or just blocks behaving
_similar_ to BEGIN blocks?

Until now, I thought the binary code trees of BEGIN blocks
(and later of CHECK blocks as well) are removed after
they have executed. Is this true? In other words: does a
B::Bytecode-d script still contain BEGIN and CHECK
blocks and are these executed whenever the script starts?
If not, where can I place code I want to be executed
_before_ the main scripts code gets executed? Is it this
what INIT blocks were made for?

MTAI for your answers, and kind greetings from Vienna

Ferry

--
Ing. Ferry Bolhar
Municipality of Vienna, Department 14
A-1010 Vienna / AUSTRIA
E-mail: bol@xxxxxxxxxxxxxxxxx


.



Relevant Pages

  • Re: BEGIN <> BEGIN
    ... Ferry Bolhar wrote: ... compiled script with B::Deparse, ... B::Bytecode-d script still contain BEGIN and CHECK ... and kind greetings from Vienna ...
    (comp.lang.perl.misc)
  • Re: [WR] round tuits
    ... Jackson Pillock wrote: ... I do, too many projects going, not enough time, priorities lean toward ... I started writing a precinct drama set in a locked psychiatric ward. ... Sent off my script. ...
    (misc.writing)
  • Re: crisis Perl
    ... As to writing good code to begin with, ... the top of the script. ... the "use warnings;" line won't actually change ... recommended declaring variables IN AS SMALL AS SCOPE AS POSSIBLE. ...
    (comp.lang.perl.misc)
  • Marginally archaeaology: Eight scripts that still cant be read
    ... WRITING is one of the greatest inventions in human history. ... literate civilisation at the time of the ... So how do you decipher an unknown script? ... there must be some link to a known language. ...
    (sci.archaeology)
  • Re: Vinca script, cross bar angle - Ki Ri Ke
    ... of the Goddess, since the English title of the second book ... sacred script in The Goddesses and Gods of Old Europe, ... not exactly a scholarly publisher. ... writing scholars call "ideograms," and hence not as writing. ...
    (sci.lang)