in reply to launch xterm for STDIO to perl script for telnet

what i have:

1. parent.pl starts, prompt for login data (user/pw), starts socket server and waiting for a hostname via stdin
2. once a hostname is typed, it executes a system("xterm -e client.pl") an waits for next input
3. the client.pl (in its own terminal) connects to the parent an fetches the login data & hostname.
4. then the client.pl opens a connection via expect.pm to the router, authenticates and gives the user control over the terminal

what i want:

1. script starts, prompt for login data (user/pw) and waiting for a hostname via stdin.
2. once a hostname is typed, a process(child) is forked and login data & hostname is piped to it.
3. the child starts its own xterm an connects therein to the router. <- no idea howto !?
4. after the authentication procedure, stdio is given to the user via the xterm <- also no idea howto..

hope this explanation is more clear :)