#!/usr/bin/perl -w use strict; $|=1; print "What is your name?"; my $name=<>; chomp $name; print "Hello, $name, nice to meet you\n\n"; my $choice=''; while($choice ne 'q') { print "a. Print 1+1\n"; print "b. Print Hi\n"; print "q. Quit!\n"; $choice=<>; chomp $choice; if ($choice eq 'a') {print "1+1=2\n";} if ($choice eq 'b') {print "Hi $name !\n";} } #### service yourscriptname { disable = no socket_type = stream wait = no user = root server = /path/to/your/script } #### yourscriptname portno/tcp