BEGIN <> BEGIN
- From: "Ferry Bolhar" <bol@xxxxxxxxxxxxxxxxx>
- Date: Wed, 31 May 2006 11:32:02 +0200
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
.
- Follow-Ups:
- Re: BEGIN <> BEGIN
- From: xhoster
- Re: BEGIN <> BEGIN
- From: Bob Anastasia
- Re: BEGIN <> BEGIN
- Prev by Date: Re: basic regex back reference
- Next by Date: Re: How do I run a Perl script as a Windows XP Service?
- Previous by thread: basic regex back reference
- Next by thread: Re: BEGIN <> BEGIN
- Index(es):
Relevant Pages
|