Perl Script Listening On A TCP Port

Hi,

Im programming a perl script which will act as a daemon listening on a tcp port (2323) and will take (<stdin>) from the client (im going to use telnet) and run the arguments from (<stdin>) against an program already on the server, which is used to list books in the library at uni.

So far my script looks like this:

#!/hari/library/local/bin/perl

print "library> ";
$arguments = (<STDIN>);

As you can see i havent got very far and need some help with the sockets.

This is how i want the daemon-perl-script to function.

Listen on port 2323
If a connection comes in print out some stuff and a promt for a command like 'library>'
take any arguments from (<stdin>) and run them against a command, i think passthru can do that:

passthru( "/some/program \"$arguments\"" );

and then send the output from the program to <stdout>
and finaly print another prompt letting the user know they can type another command.

Sorry if this is really boring, but i cant find any sockets tutorials for perl,

Also in a perl script when i run system( "clear " ) it doesnt clear <stdout>, is there a way i can do this?

Cheers,

Elfyn

If there are words missing where there are just () its suppost to be stdin/stdout but its being strippen as html

Sorry I don't know the answer but you might want to check perlmonks.com. They have always helped me with complex perl questions in the past.