script/alvis-pipeline-put.pl untested

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 4 Podpod n/a totaltotal 0.0% 0 / 32 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/local/bin/perl -w
2  
3 # $Id: alvis-pipeline-put.pl,v 1.4 2005/09/30 16:20:37 mike Exp $
4  
5 use strict;
6 use warnings;
7 use IO::File;
8 use Alvis::Pipeline;
9  
10 die "Usage: $0 <host> <port>" if @ARGV != 2;
11 my($host, $port) = @ARGV;
12 my $loglevel = 3; ### should be settable from command-line
13  
14 my $pipe = new Alvis::Pipeline::Write(host => $host, port => $port,
15 loglevel => $loglevel)
16 or die "can't create write-pipe for host '$host', port '$port': $!";
17  
18 my $count = 1;
19 while (1) {
20 my $xml = <<__EOT__;
21 <?xml version="1.0" encoding="UTF-8"?>
22 <count>This is document number $count</count>
23 __EOT__
24 $pipe->write($xml);
25 print "Wrote document $count to the pipe\n";
26 $count++;
27 sleep(int(rand() * 5) + 1);
28 }