in reply to writing output to screen with telnet.pm
You could always use the Perl debugger and step through each line.
perl -d yourprogram.pl [download]