summaryrefslogtreecommitdiffstats
path: root/doc/examples
diff options
context:
space:
mode:
Diffstat (limited to 'doc/examples')
-rwxr-xr-xdoc/examples/status.pl17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/examples/status.pl b/doc/examples/status.pl
new file mode 100755
index 0000000..11cea0d
--- /dev/null
+++ b/doc/examples/status.pl
@@ -0,0 +1,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;
+}