Moved perl.c over to C++

We're now using the normal std::clog logging and the Library object to
simplify the code.  No functional changes at this point.