in reply to writing to telnet?

well, here is another program i made that will write to telnet, it doesnt use fork so it cannot listen at the same time, does anybody know how i could incorporate fork into this. sorry i havent really used fork much.
#!/usr/bin/perl use strict; use warnings; use IO::Socket; my $server = IO::Socket::INET->new ( LocalPort => 1337, Type => SOCK_STREAM, Reuse => 1, Listen => 5 ) or die "could not open port\n"; warn "server is ready for connection..... \n"; while (my $client = $server->accept()) { warn "client connected\n"; #while($line = <$client>){ #print $line;} my $line = <>; print $client $line; } close($server);