Arthur Bergman wrote: > > > > What's needed IMO is yet another special code block -- COMPILED, START, > > better names welcome -- run when the compilation of the said > > compilation > > unit ends, regardless of the state of the main perl interpreter. > > > > No I disagree, I want to know apply the B::module magic after I require > something runtime too. So write another B:: loader -- see below > I guess what we need is a hook that gets called whenever a compilation > of a outer lexical scope (file, eval"") is completed. A START block, then. So #!/usr/bin/perl eval q{ BEGIN { print 1; } START { print 2; } CHECK { print 3; } INIT { print 4; } print 5; END { print 6; } }; print 7; __END__ would print "12576". You could then write an alternative to O.pm that loads B::* from a START block instead of from a CHECK block. The whole CHECK magic is entirely done in O -- there's no reason to stop poeple from using B:: modules apart from the O framework.Thread Previous | Thread Next