From f8d45bbe9eacbcfcea91f0d34fe972b37db36da4 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 15 Sep 2014 17:40:21 +0200 Subject: Add status.pl example script --- doc/examples/status.pl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 doc/examples/status.pl 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 \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; +} -- cgit v1.2.3