Dave Burt wrote:

> Is there a way to do that in Ruby? Can a C extension concievably alter 
> following code before it is parsed? I think I'm expecting a simple "no".

If you are allowed to alter the shebang then you can append -ryourlib 
and steal STDIN from Ruby and use eval() to execute the filtered code.