in reply to Are codefilters restricted to valid code?

Source code filters are definitely not restricted to valid code. You could, for example, use a source filter to decrypt some encrypted source stream (see Filter::decrypt that comes with the module Filter::Util::Call for a demo implementation, if interested). In other words, the problem lies elsewhere :)