#!perl use strict; use warnings; $| = 1; print "* Hi there, to read\n"; while (1) { print "read: "; my $command = <>; chomp $command; if ($command eq 'ping') { print "pong\n"; } elsif ($command eq 'quit') { exit; } }