Thanks for the report. This is because when nothing is actually happening in the main scope of the program it's treated as an OP_STUB which causes Perl_newPROG() to skip out before setting PL_main_start; which is what the warning requires: (Inside of Perl_newprog()): if (o->op_type == OP_STUB) { PL_comppad_name = 0; PL_compcv = 0; S_op_destroy(aTHX_ o); return; < -- Returns here } PL_main_root = op_scope(sawparens(scalarvoid(o))); PL_curcop = &PL_compiling; PL_main_start = LINKLIST(PL_main_root); < -- This is needed (The warning check:) if (PL_main_start) Perl_ck_warner(aTHX_ packWARN(WARN_VOID), "Too late to run CHECK block"); This warns correctly for example: perl -we'INIT { eval "CHECK {print qq:in check in init\n:}" } print "hi";' Since the CHECK blocks don't actually get run, the warning should still get generated. Does PL_main_start (and PL_main_root, etc..) need to get set even when it's just an OP_STUB? Or is this an unlikely / illogical situation? -- Matthew Horsfall (alh)Thread Previous | Thread Next