in reply to Re^3: repeated use of module and EXPORT
in thread repeated use of module and EXPORT
The basic description is found in perlmod:
A "BEGIN" code block is executed as soon as possible, that is, the moment it is completely defined, even before the rest of the containing file (or string) is parsed. You may have multiple "BEGIN" blocks within a file (or eval'ed string) -- they will execute in order of definition. Because a "BEGIN" code block executes immediately, it can pull in definitions of subroutines and such from other files in time to be visible to the rest of the compile and run time. Once a "BEGIN" has run, it is immediately undefined and any code it used is returned to Perl's memory pool.
Also note that use has an implicit BEGIN block around it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: repeated use of module and EXPORT
by rpelak (Sexton) on May 23, 2008 at 19:47 UTC | |
by shmem (Chancellor) on May 23, 2008 at 20:34 UTC | |
by rpelak (Sexton) on May 23, 2008 at 23:08 UTC | |
by ikegami (Patriarch) on May 24, 2008 at 06:23 UTC | |
by ikegami (Patriarch) on May 24, 2008 at 06:29 UTC | |
by rpelak (Sexton) on May 24, 2008 at 19:38 UTC | |
by shmem (Chancellor) on May 24, 2008 at 22:38 UTC |