See the eval filter in Template::Manual::Filters.
In reply to Re^3: Include code in Template Toolkit by Your Mother in thread Include code in Template Toolkit by heisersch