summaryrefslogtreecommitdiffstats
path: root/doc/examples/status.pl
blob: 11cea0d0cb75b838a802971bf173906698b4af34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl -w

use strict;

use IO::Socket::UNIX qw( SOCK_STREAM );

$ARGV[0] or die("Usage: status.pl <socket>\n");

my $socket = IO::Socket::UNIX->new(
   Type => SOCK_STREAM,
   Peer => $ARGV[0],
)
   or die("Can't connect to server: $!\n");

foreach my $line (<$socket>) {
	print $line;
}