Try running with warnings enabled:
$ perl -wle 'eval " print 1; INIT { print 2 } END { print 3 } BEGIN { print 4 } CHECK { print 5 } "' Too late to run INIT block at (eval 1) line 3. 4 Too late to run CHECK block at (eval 1) line 6. 1 3
What happens is that "string eval" code is compiled after the run-time has been initialised, therefore it's too late for INIT/CHECK mechanism.
In reply to Re: eval() and INIT{}
by calin
in thread eval() and INIT{}
by powerman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |