A plug-in can be created to allow for scripts found in templates to be executed.
For example, a template could be written in PHP and another in perl.
This is counter intuitive since you'd think everything would be in C++. However, a feature could be developed using a Ruby script at first and later re-written in C++ and compiled in the server as a normal plug-in.
Also, some libraries are available in a scripting language, such as Java, and not in C++. It would be a shame to not be able to use such just because it isn't the same language.
Note that we could also run standard shell commands such as sed and awk.