in reply to Re: Can't call sub within same package in BEGIN block
in thread Can't call sub within same package in BEGIN block
However I also provided some overloading condition to be made on the %ENV by other modules, so the contents inside the BEGIN maybe need to rerun (and some extra modules maybe import), thaz why I pulled the codes out from BEGIN and form a sub (coz BEGIN can't export), so BEGIN and other modules can share the same operations.
What I still don't understand is why use subs lost this race. Say:
strict can effective immediately and alarm $x was not declared, but why not subs ?use strict; use subs "TestMe"; BEGIN { $x = 10; TestMe(); } sub TestMe {"Test fine"}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Can't call sub within same package in BEGIN block
by Anonymous Monk on Aug 14, 2014 at 08:07 UTC | |
by exilepanda (Friar) on Aug 14, 2014 at 08:32 UTC | |
|
Re^3: Can't call sub within same package in BEGIN block
by ikegami (Patriarch) on Aug 14, 2014 at 16:08 UTC | |
by exilepanda (Friar) on Aug 14, 2014 at 23:26 UTC |