in reply to Reading sourcecode at parsing/compilation (CHECK) time?
this workaround helps caching a snapshot of the source of the corresponding file (path is in $0) and bypasses the problems of Attribute::Handlers.
UNITCHECK { my $pos=tell DATA; seek DATA,0,0; $main::SOURCE{$0}=[<DATA>]; seek DATA,$pos,0; }
works fine I can access the hash %main::SOURCE from everywhere, but ATM I'll have to include this block in any module I wanna process.
Is there a global option to automatically include an UNITCHECK in any compiled file?
UPDATE: Hmm ...or maybe I could gather all processed filenames so far from %INC, which I may process in one global CHECK block...
Cheers Rolf
|
|---|