#!perl
use strict;
use warnings;
$| = 1;

my $what = (shift @ARGV) || "there";
print "* Hi $what, to read\n";

while (1) {
  print "read: ";
  my $command = <>;
  chomp $command;

  if ($command eq 'ping') {
    print "pong\n";
  } elsif ($command eq 'quit') {
    exit;
  }
}
