Actually, mod_perl is just a platform within which you run your code. See http://perl.apache.org/ for details on mod_perl. Essentially, your CGI scripts can be used as is to run inside a special mod_perl handler process. Or you can rewrite your scripts to use mod_perl's handler API directly.
Thus, you can probably use your code as is within mod_perl (though, you'll still need some modification to cache your telnet connection) or you can rewrite it to use the mod_perl framework directly, if you prefer.