Hello friends,
I’ve designed a fairly complex (aka inefficient) script to parse large (300 mb) files into usable EDI test data. I’m so proud of this script that every coffee break, lunch hour, and paycheck distribution, I find myself tinkering with it. I’ve about run out of things to do with this script, so I thought I would see about putting it on a centralized server and accessing it through telnet (like everything else I a use). My question is, is there a simple way to convert a script from printing to the screen – to printing to a socket in an interactive telnet session? It would be nice if I could pipe the remote socket input into <STDIN> and print data to the socket for the remote client. Is this crazy, foolish, or just another act of boredom? I know I could do it through CGI, but that’s been done, I know I could output it to a file for FTP (*Yawn*), but has anyone done this in a simple way that I could do without rewriting my entire script? I’ll worry about security later (I thought I’d never hear myself say that); I just want to know how hard this thing will be. I’ve got a little script for you, I can’t post the real deal because it contains proprietary information, but you get the idea. Thanks, and sorry for the rambling :)
use strict;
my($first,$second,$result);
BEGIN:
print "Input first number (of two) for addition.\n";
$first = <STDIN>;
chop($first);
print "Input second number.\n";
$second = <STDIN>;
chop($second);
$result = $first + $second;
print "$first \+ $second \= $result\n\n\n";
goto BEGIN;