File: read

package info (click to toggle)
libtest-expect-perl 0.34-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 96 kB
  • ctags: 11
  • sloc: perl: 134; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 277 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!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;
  }
}