# MyStuff.pm package MyStuff; use strict; BEGIN { _init() } sub _init{ .... } 1;
This won't work and saying undefined subroutine etc etc
I tried use subs "_init";, tried to call it MyStuff::_init() in the BEGIN block, but both failed. The only workaround is to put the sub _init above the BEGIN block, and it works.
Why is that? And is that anyway I can make that sub below the BEGIN block ?
In reply to Can't call sub within same package in BEGIN block by exilepanda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |