Yes, it's certainly possible to write such a program using perl...infact perl is probably the best language to use for such a project.
If your interested in going ahead with the fix, i would check out
this here perl module.
It will allow you to create a telnet session (using perl) to a port that you tell it and then allow you to execute commands on that remote computer.
As always, CPAN does a good job of the documentation with the perl module, so there are examples and lists all the methods and their options.