Consider the trivial example of module:Your trivial example is missing "use warnings;". Use warnings, perhaps especially in trivial examples:package Test1;
$ cat Foo.pm use warnings; CHECK { print "in check\n" } INIT { print "in init\n" } 1; $ perl -e'require Foo' Too late to run CHECK block at Foo.pm line 2. Too late to run INIT block at Foo.pm line 3. $ perl -e'use diagnostics; require Foo' Too late to run CHECK block at Foo.pm line 2 (#1) (W void) A CHECK or INIT block is being defined during run time pr +oper, when the opportunity to run them has already passed. Perhaps you +are loading a file with require or do when you should be using use instead. Or perhaps you should put the require or do inside a BEGIN block. Too late to run INIT block at Foo.pm line 3 (#1)
In reply to Re: use equivalent ? I suspect not...
by ysth
in thread use equivalent ? I suspect not...
by Bloodnok
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |