a bit more complex example on using perl and c++