http://www.perlmonks.org?node_id=1033913


in reply to Re^4: how to make this perl code run
in thread how to make this perl code run

> This untested code should work ...

And you think none of us tested this already and we all were too modest to post a code that works???

8)

The parser needs to see the declaration before it parses the barewords.

BEGIN-blocks don't change the parsing order, only the runtime order!

Cheers Rolf

( addicted to the Perl Programming Language)

update

to be precise BEGIN-Block are run at parsing time, but the parsing order doesn't change. see perlmod

Replies are listed 'Best First'.
Re^6: how to make this perl code run
by Anonymous Monk on May 16, 2013 at 22:13 UTC

    Of course (about everybody being modest:>).

    In any case this did remind me of the reason to generate subs in BEGIN block near the very start of a module.